| ||||||||||
| 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 | |||||||||
Re:哪里错了???真的不知道In Reply To:哪里错了???真的不知道 Posted by:jecopeng at 2006-09-10 15:57:57 看下输出??
> #include <iostream>
> #include <string>
> using namespace std;
> int main(){
> int n;
> cin>>n;
> int i,j;
> for(i=0;i<n;i++){
> char streetname[100];
> cin>>streetname[0];
> for(j=1;streetname[j-1]!='\n';j++)
> streetname[j]=getchar();
> streetname[j-1]='\0';
> int sum;
> cin>>sum;
> string str;
> cin>>str;
> char contrl;
> cin>>contrl;
> int count=0;
> int temp;
> int min,max,step;
> int digit[10]={0,0,0,0,0,0,0,0,0,0};
> for(;count!=sum;){
> if(contrl=='+'){
> cin>>min>>max>>step;
> for(;min<=max;min+=step){
> count++;
> temp=min;
> while(temp>=10){
> digit[temp%10]++;
> temp/=10;
> }
> digit[temp]++;
> }
> }
> else{
> cin>>min;
> temp=min;
> while(temp>=10){
> digit[temp%10]++;
> temp/=10;
> }
> digit[temp]++;
> digit[contrl-'0']++;
> count++;
> }
> if(count==sum) break;
> cin>>contrl;
> }
> cout<<streetname<<endl;
> cout<<sum<<' '<<str<<endl;
> for(j=0;j<10;j++)
> cout<<"Make "<<digit[j]<<" digit "<<j<<endl;
> cout<<"In total "<<digit[0]+digit[1]+digit[2]+digit[3]+digit[4]+digit[5]+digit[6]+digit[7]+digit[8]+digit[9]<<" digits"<<endl;
> }
> return 0;
> }
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator