返回列表 發帖

==生命靈數==

本帖最後由 p17johnny 於 2011-11-12 20:04 編輯
  1. #include<iostream>
  2. #include<fstream>
  3. using namespace std;
  4. int main()
  5. {
  6.     fstream fin,fout;
  7.         fin.open("pf.in",ios::in);
  8.         fout.open("pf.out",ios::out);
  9.         int ymd;
  10.         int t;
  11.         fin >> t;
  12.         int a=0,b=0,d=0,c=0;
  13.         for(int i=1;i<=8;i++)
  14.         {
  15.         a=ymd%10+a;
  16.         c=ymd%10+a;
  17.         ymd=ymd/10;
  18.         }
  19.     if(t>=10)
  20.             {
  21.             d=t/10;
  22.             b=t%10;
  23.             t=d+b;
  24.             d=0 ;
  25.             b = 0 ;
  26.             }
  27.             if(t>=10)
  28.             {
  29.             d=t/10 ;
  30.             b=t%10 ;
  31.             t=d+c;
  32.             }
  33.         if(t==2)
  34.         {
  35.         fout<< t << ", Yes"<< endl ;
  36.         }else
  37.         {
  38.         fout<< t << ", No" << endl ;
  39.         }
  40.        
  41.        
  42.         fin.close();
  43.         fout.close();
  44.        
  45.         return 0;
  46.         }
複製代碼
求解其他人的解題方法
附件: 您需要登錄才可以下載或查看附件。沒有帳號?註冊
分數掛蛋的心情像空白的紙,再次期望著奇蹟的到來。

返回列表