Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
求助#include<stdio.h> #include<string.h> #include<math.h> char s1[100],s2[100]; int main(void) { while(scanf("%s",s1) && strcmp(s1,"#")) { scanf("%s",s2); int i; bool small=false,big = false,equal = true; long long result = 0 ; int num_of_que = 0; for(i=0;s1[i];i++) { if(s1[i] == '?') num_of_que++; } if(num_of_que==0) { if(strcmp(s1,s2)>0) puts("1"); else puts("0"); continue; } for(i=0;s1[i];i++) { if(s1[i]!='?') { if(s1[i]>s2[i] && !small) { big = true; equal = false; } if(s1[i] < s2[i] && !big) { small = true; equal = false; } } else { if(big) { result += (long long)pow(10.0,num_of_que*1.0); break; } if(equal) { result += ('9'-s2[i])*(long long)pow(10.0,(num_of_que-1)*1.0); } num_of_que--; } } printf("%lld\n",result); } return 0; } 哪里错了啊 好心人给点数据啊 Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator