返回

猜数字

发布时间:2022-12-29 06:52:49 272
# ios
#define _CRT_SECURE_NO_WARNINGS 1 
using namespace std;
#include
#include
#include


//1、猜数字
//int main()
//{
// srand((unsigned int)time(NULL));
// int lucknum = rand() % 100 + 1;
// int usenum = 0;
//
// while (1)
// {
// cout << "请输入你要猜的数字:>" << endl;
// cin >> usenum;
//
// if (usenum > lucknum)
// cout << "猜大了" << "\n";
// else if (usenum < lucknum)
// cout << "猜小了" << "\n";
// else
// {
// cout << "恭喜你,猜对了";
// break;
// }
// }
// return 0;
//}


//2、水仙花数
//int main()
//{
// int num = 0;
// int a, b, c;
// for (num = 100; num < 1000; num++)
// {
// a = num / 100;
// b = num / 10 % 10;
// c = num % 10;
// /*if (a * a * a + b * b * b + c * c * c == num)
// {
// cout<
// }*/
// if (pow(a, 3) + pow(b, 3) + pow(c, 3) == num)
// {
// cout << num << endl;
// }
// }
// system("pause");
// return 0;
//}


//3、敲7游戏
//int main()
//{
// for (int i = 1; i < 100; i++)
// {
// if (i % 7 == 0 || i / 10 == 7 || i % 10 == 7)
// {
// cout << "敲7" << endl;
// }
// else
// {
// cout << i << endl;
// }
// }
// system("pause");
// return 0;
//}

//4、乘法口诀表
//int main()
//{
// int i, j;
// for (i = 1; i <= 9; i++)
// {
// for (j = 1; j <= i; j++)
// {
// cout << j << "*" << i << "=" << i * j << "\t";
// }
// cout << endl;
// }
// system("pause");
// return 0;
//}
特别声明:以上内容(图片及文字)均为互联网收集或者用户上传发布,本站仅提供信息存储服务!如有侵权或有涉及法律问题请联系我们。
举报
评论区(0)
按点赞数排序
用户头像
精选文章
thumb 中国研究员首次曝光美国国安局顶级后门—“方程式组织”
thumb 俄乌线上战争,网络攻击弥漫着数字硝烟
thumb 从网络安全角度了解俄罗斯入侵乌克兰的相关事件时间线
下一篇
蓝桥杯练习 2022-12-29 06:22:41