回覆列表
  • 1 # 使用者5443769950533

    程式一為:

    #include

    void main()

    {

    int a,b,c,s;

    cout

    cin>>a>>b;

    s=a+b;

    cout

    cout

    cin>>c;

    if(c==s)

    cout

    else

    cout

    }

    程式二為:#include

    void main()

    {

    int a,b,c,s;

    cout

    cin>>a>>b;

    s=a+b;

    cout

    cout

    cin>>c;

    while(c!=s)

    {

    cout

    cout

    cin>>c;

    }

    cout

    }

    程式三為:#include

    void main()

    {

    int a,b,c,s,n;

    cout

    cin>>a>>b;

    s=a+b;

    cout

    cout

    cin>>c;

    for(n=1;n

    {

    if(c!=s)

    {

    cout

    cout

    cin>>c;

    n++;

    }

    else

    cout

    break;

    }

    cout

    }

    程式四為:#include

    #include

    #include

    using namespace std;

    void main()

    {

    int a,b,c,s,n=0,m,k,z;

    for(int i=1;i

    {

    cout

    int j= rand();

    int k= rand();

    a=j%10;

    b=k%10;

    cout

    s=a+b;

    cout

    cout

    cin>>c;

    if(c==s)

    {

    cout

    n++;

    }

    else

    cout

    }

    m=10-n;

    k=10*n;

    cout

    cout

    }

    這幾個我都除錯過了,沒問題的!

  • 中秋節和大豐收的關聯?
  • 狗狗體味嚴重時,會出現哪些情況?