还不懂,SOS!!!SOS!!!
谢谢,但是不是我要的结果。再帮我一下。我要显示sum=5
5*1=5
5*2=10
5*3=15
...
[解决办法]
sum = 5;
cout < <sum < < "*1= " < <sum*1;
cout < <sum < < "*2= " < <sum*2;
....
[解决办法]
C代码:
sum = 5;
printf( "sum=%d ",sum);
printf( "%d*1=%d ",sum,sum*1);
printf( "%d*2=%d ",sum,sum*2);
printf( "%d*3=%d ",sum,sum*3);
....
[解决办法]
#include <stdio.h>
#include <iostream>
using namespace std;
void main()
{
int sum,num1,num2,num3,num4,num5,num6,num7,num8,num9,num10;
printf( "\n 请输入一个数字: ");
scanf( "%d ",&sum);
for(int i = 1;i <11;i++)
{
cout < <sum < < "* " < <i < < "= " < <sum*i < <endl;
}
system( "pause ");
}
你输入5就行,这下应该可以了吧