程式一為:
#include
void main()
{
int a,b,c,s;
cout
cin>>a>>b;
s=a+b;
cin>>c;
if(c==s)
else
}
程式二為:#include
while(c!=s)
程式三為:#include
int a,b,c,s,n;
for(n=1;n
if(c!=s)
n++;
break;
程式四為:#include
using namespace std;
int a,b,c,s,n=0,m,k,z;
for(int i=1;i
int j= rand();
int k= rand();
a=j%10;
b=k%10;
m=10-n;
k=10*n;
這幾個我都除錯過了,沒問題的!
程式一為:
#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
}
這幾個我都除錯過了,沒問題的!