#include<stdio.h> int main() { char a=0 ,c=0; int b=0; for(;a!=46;) { scanf("%c",&a); if (a!=32&&a!=46) { b++; } else { if(b!=0){ printf("%d",b); break;} } } b=0; for(;a!=46;) { scanf("%c",&a); if (a!=32&&a!=46) { b++; } else { if (b!=0) printf(" %d",b); b=0; } } }
句中单词长度
#include<stdio.h> #include<string.h> int main() { char a[71]="" ,x,y; int j=(a[1]^a[2]),cz,count=3,p,q,shijian[6]; for(;a[0]!=69;){ scanf("%s",&a); x=a[69],y=a[70]; if(a[18]==65){ cz=strlen(a)-3; j=(a[1]^a[2]); for(count=3;count<cz;count++) { j=j^a[count]; } //printf("%d",j); p=j/16; q=j%16; switch (p){ case 0:p=48;break; case 1:p=49;break; case 2:p=50;break; case 3:p=51;break; case 4:p=52;break; case 5:p=53;break; case 6:p=54;break; case 7:p=55;break; case 8:p=56;break; case 9:p=57;break; case 10:p=65;break; case 11:p=66;break; case 12:p=67;break; case 13:p=68;break; case 14:p=69;break; case 15:p=70;break; } switch (q){ case 0:q=48;break; case 1:q=49;break; case 2:q=50;break; case 3:q=51;break; case 4:q=52;break; case 5:q=53;break; case 6:q=54;break; case 7:q=55;break; case 8:q=56;break; case 9:q=57;break; case 10:q=65;break; case 11:q=66;break; case 12:q=67;break; case 13:q=68;break; case 14:q=69;break; case 15:q=70;break; } if (p==x&&q==y) { char *w; int count=5,z=0; for(count=5;count>=0;count--){ w=(char *)a+7+count; shijian[count]=(int)*w-48; } } } } int xs; xs=10*shijian[0]+shijian[1]; if(xs==1){ printf("09:%d%d:%d%d",shijian[2],shijian[3],shijian[4],shijian[5]); } else if(1<xs<16){ xs=xs+8; printf("%d:%d%d:%d%d",xs,shijian[2],shijian[3],shijian[4],shijian[5]); } else {xs=xs+8-24; printf("0%d:%d%d:%d%d",xs,shijian[2],shijian[3],shijian[4],shijian[5]); } } //
信号 定位错误
时间: 2024-10-12 13:04:26