#include<stdio.h>
#include<conio.h>
void main()
{
int i=1,a,b,c,choice;
do
{
printf("enter any two numbers\n");
scanf("%d%d",&a,&b);
printf("pressing one add the two numbers\nenter one if you want to\n");
scanf("%d",&choice);
switch(choice)
{
case 1:
{
c=a+b;
printf("the sum of the entered numbers%.1f\n\n:",c);
break;
}
default:
printf("you have entered an invalid");
break;
}
clrscr();
}
while(i==1);
getch();
}
我不知道,因为我的同学正在使用 Turbo C,这很好,对我来说,我正在使用 dev C++,但看起来像 clrscr();不知道编译器请帮忙。
你的同学在DOS下编程,显然你不会...conio.h
附带 Turbo C 和 DOS ...所以,删除这些行
#include<conio.h>
and
clrscr();
and
getch();
使你的程序编译...
...并且不要使用%.1f
打印一个 int。
... and main()
必须返回int
*并且不要抄袭你同学的...他似乎还停留在石器时代*
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)