#include<stdlib.h> #include<stdio.h> main() { int a,b,c,x=0; while(x<5) {a=rand()%100; b=rand()%100; if(a+b>100) continue; printf("\\n%d+%d=? ",a,b); scanf("%d",&c); if(c==a+b) {printf("the answer is right"); x++; } else {printf("The answer is wrong");x=0; } }printf("\\n program is over"); }
一个简单的随机函数
精选 转载下一篇:二进制加法
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
写一个php memcache 简单的函数
php memcache 简单的使用范例
php 系统优化 缓存 memcache -
一个简单的判断子串个数的函数
MySQL本身没有判断子串个数的函数。
函数 MYSQL 数据库 判断 串个数 -
一个简单的伪随机数发生算法
源:一个简单的伪随机数发生算法
#include 随机数 c语言 d3 随机算法