#7067: 测验都可以,但送出是CE


xuzefeng (神)

學校 : 不指定學校
編號 : 26937
來源 : [59.33.104.56]
最後登入時間 :
2013-02-25 21:13:56
a010. 因數分解 | From: [183.32.173.237] | 發表日期 : 2012-10-13 15:13

#include<iostream>
using namespace std;
int main()
{
    int a;
    while(cin>>a)
    {
        int flag=0,i=2,b;
        while( a!=1 )
        {
           if(a%i==0)
           {
              if(flag==0)
              {
                    cout<<i;
                    b=i;
                    flag=1;
              }
              else
              {
                    if(b!=i)
                    {
                      cout<<" * "<<i;
                     
                    }
                    else
                    {
                      cout<<"^"<<i;
                                    
                    }
              }
              a=a/i;
          
           }
           else
           {
              i++;
           }
   
        }
        cout<<endl;
     }
        
         system("pause");
         return 0;
}   
#7160: Re:测验都可以,但送出是CE


akira0331 (小迷糊)

學校 : 不指定學校
編號 : 26613
來源 : [203.70.194.240]
最後登入時間 :
2013-07-29 09:30:29
a010. 因數分解 | From: [203.70.194.240] | 發表日期 : 2012-11-06 14:46

#include
using namespace std;
int main()
{
    int a;
    while(cin>>a)
    {
        int flag=0,i=2,b;
        while( a!=1 )
        {
           if(a%i==0)
           {
              if(flag==0)
              {
                    cout<                    b=i;
                    flag=1;
              }
              else
              {
                    if(b!=i)
                    {
                      cout<<" * "<                     
                    }
                    else
                    {
                      cout<<"^"<                                    
                    }
              }
              a=a/i;
          
           }
           else
           {
              i++;
           }
   
        }
        cout<     }
        
         system("pause");
         return 0;


看了以前很多人的討論,這個測試平台好像不能用 system("pause"); 將它移除吧 
ZeroJudge Forum