Here is circulating on Weibo photo: "Dear students, given that we sometimes need to use wifi, afraid to delay the pro learning, now wifi password is set to answer the following math problem: A-1; B- 2; C-3; D-4;. ask someone to answer their own, a change every two days - thank you !! "- teachers to promote student learning is the fight ...... this question requires you to write a series of procedures to the answer to the title translated into the wifi password is given in accordance with the correspondence between the papers. Here simply assume that each multiple-choice questions have four options and only one correct answer.
Input formats:
The first input line is given a positive integer N ( ≤ 100), followed by N rows, each row in accordance with the 编号-答案
given four options a question format, T
showing the correct option, F
an error option. Separated by spaces option.
Output formats:
Output wifi passwords in a row.
Sample input:
8
A-T B-F C-F D-F
C-T B-F A-F D-F
A-F D-F C-F B-T
B-T A-F C-F D-F
B-F D-T A-F C-F
A-T C-F B-F D-F
D-T B-F C-F A-F
C-T A-F B-F D-F
Sample output:
13224143
#include <iostream> using namespace std; int main(){ int N;char s[4]; cin>>N; while(N--){ for(int i=0;i<4;i++){ scanf("%s",s); if(s[2]=='T') cout<<(s[0]-'A'+1); } } system("pause"); return 0; }