C语言两位数的加法小程序

时间:2022-07-11 20:10:15 阅读: 最新文章 文档下载
说明:文章内容仅供预览,部分内容可能不全。下载后的文档,内容与下面显示的完全一致。下载之前请确认下面内容是否您想要的,是否完整无缺。


C语言两位数的加法小程序

#nclude "stdio.h " #include "conio.h " main()

{int a,b,c,s=0; int i;

srand(time(NULL)); /*随计算机时钟而产生的随机函数*/ { for( i = 1;i <=6;i++)

{a=10+(rand()%10); b=10+(rand()%10);

textcolor(14);

cprintf( "\n\n%d+%d= ",a,b);

textcolor(15);

cscanf( "%d ",&c);

if(c==a+b) s=s+10; }}

textcolor(12); cprintf( "\nyour is %d ",s);

getch();




本文来源:https://www.wddqw.com/doc/758f090fd6d8d15abe23482fb4daa58da1111c4c.html