通用串行總線USB(Universal Serial Bus)是一種新型的微機總線接口規范。隨著客戶對系統數據采集速度要求的不斷提高,USB以其使用方便、易于擴展、速度快等優點而越來越多的應用于數據采集系統中。本文介紹了一種基于USB總線的數據采集系統的設計方法,采用PHILIPS公司的USB接口芯片PDIUSBD12與單片機AT89C51進行通信,并和PC機通信而編制出友善的設備應用程序。該系統用傳統的USB總線取代了RS232串行總線,通過對USB協議和設備構架的充分理解,對以單片機89C51和USB接口芯片PDIUSBD12為主的數據采集系統進行了硬件設計和軟件編程,并在此設計的基礎上給出相應的原理圖。硬件設計主要解決的是PDIUSBD12和ADC0809與單片機之
HDOJ ACM
input:The input consists of T test cases. The number of test cases ) (T is given in the first line of the input. Each test case begins with a line containing an integer N , 1<=N<=200 , that represents the number of tables to move. Each of the following N lines contains two positive integers s and t, representing that a table is to move from room number s to room number t (each room number appears at most once in the N lines). From the N+3-rd line, the remaining test cases are listed in the same manner as above.