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


xuzefeng (神)


#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 (小迷糊)


#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"); 將它移除吧