本帖最後由 p17johnny 於 2011-11-12 20:04 編輯
- #include<iostream>
- #include<fstream>
- using namespace std;
- int main()
- {
- fstream fin,fout;
- fin.open("pf.in",ios::in);
- fout.open("pf.out",ios::out);
- int ymd;
- int t;
- fin >> t;
- int a=0,b=0,d=0,c=0;
- for(int i=1;i<=8;i++)
- {
- a=ymd%10+a;
- c=ymd%10+a;
- ymd=ymd/10;
- }
- if(t>=10)
- {
- d=t/10;
- b=t%10;
- t=d+b;
- d=0 ;
- b = 0 ;
- }
- if(t>=10)
- {
- d=t/10 ;
- b=t%10 ;
- t=d+c;
- }
- if(t==2)
- {
- fout<< t << ", Yes"<< endl ;
- }else
- {
- fout<< t << ", No" << endl ;
- }
-
-
- fin.close();
- fout.close();
-
- return 0;
- }
複製代碼 |