#include<stdio.h>intmain(void){char num[18];int sum;char C;int a[17]={7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2};char z[11]={'1','0','X','9','8','7','6','5','4','3','2'};int N;while(scanf("%d",&N)!=EOF){int t =N;int cnt =0;while( t--){
sum =0;scanf("%s",&num);int flag =0;for(int i=0;i<=16;i++)if(!( num[i]>='0'&& num[i]<='9')){
flag =1;break;}if( flag ==0){for(int i=0;i<=16;i++)for(int j=0;j<=10;j++)if( num[i]=='0'+j){
sum = sum + j * a[i];break;}
sum = sum %11;if( z[sum]== num[17])
cnt++;else{for(int i=0;i<=16;i++)printf("%c",num[i]);printf("%c\n",num[17]);}if( cnt == N )printf("All passed\n");}elseif( flag ==1){for(int i=0;i<=16;i++)printf("%c",num[i]);printf("%c\n",num[17]);}}}}
#include<stdio.h>intmain(){int i,n,u;scanf("%d",&n);int sex[51]={0}, exist[51]={0};char name[51][9];for(i =0; i < n;i++){scanf("%d %s",&sex[i], name[i]);//name[i]-行数,输入字符串,省略后面的[9]}//不能输入 \n 否则输入不成功 int x, y;for(i =0; i < n/2; i++){for(u = n-1; u >(n-1)/2; u--){if(sex[i]!= sex[u]&& exist[u]==0&& exist[i]==0){printf("%s %s\n", name[i], name[u]);
exist[i]=exist[u]=1;//选择了,两者都应该被删去,引用额外的数组判定}}}return0;}
#include<stdio.h>#include<string.h>typedefstruct{char name[15];}T;intmain(){
T t[14];int i=0;char a[]=".";//定义结束标志 while(i<14){scanf("%s",&t[i].name);if(strcmp(t[i].name,a)==0){//判断是否输入结束 break;}
i++;}
i--;//自增减一便是有效的点赞名单 if(i<1){printf("Momo... No one is for you ...");return0;}if(i>=1&& i<13){printf("%s is the only one for you...",t[1].name);return0;}if(i>=13){printf("%s and %s are inviting you to dinner...",t[1].name,t[13].name);return0;}return0;}
# include<stdio.h>intmain(){int a[5];int min_num, cha;scanf("%d%d%d%d",&a[0],&a[1],&a[2],&a[3]);scanf("%d%d",&min_num,&cha);int max = a[0];//找其中最大的值for(int i =1; i <4; i++){if(max < a[i]){
max = a[i];}}int cnt =0;int index =0;//记录那一个轮胎的下标for(int i =0; i <4; i++){if(max - a[i]> cha || a[i]< min_num){
cnt++;
index = i;}}if(cnt ==0){printf("Normal\n");}elseif(cnt ==1){//同样的,忽略了轮胎的编码和数组的下标不是相等的,而是差一个一,所以结尾需要加一printf("Warning: please check #%d!", index +1);}elseif(cnt >=2){printf("Warning: please check all the tires!\n");}return0;}
#include<stdio.h>#include<stdlib.h>#include<string.h>char str[85];int first_index =-1;// 第一个符合的位置 int s_count =0;// 总输入个数 int t_count =0;// 符合的个数 intmain(){while(1){gets(str);if(strcmp(".",str)==0)break;
s_count++;char* p =strstr(str,"chi1 huo3 guo1");if(p !=NULL){if(first_index<0) first_index = s_count;
t_count++;}}printf("%d\n",s_count);if(t_count==0)printf("-_-#");elseprintf("%d %d\n",first_index,t_count);return0;}