C++ 11.09
发布日期:2022-03-16 03:25:46
浏览次数:26
分类:技术文章
本文共 1754 字,大约阅读时间需要 5 分钟。
1、
#include<iostream>
using namespace std; int main() { for (int i = 1; i < 10; i++) { for (int j = 1; j < 10; j++) { if (i >= j) { cout << j<<"*"<<i<<" "; } } cout << endl; } system("pause"); return 0; }2、
#include<iostream>
using namespace std; int main() { int num = 0; cout << "1、简单" << endl; cout << "2、中等" << endl; cout << "3、困难" << endl; cout << "请选择难度" << endl; cin >> num; switch (num) { case 1: cout << "你选择的是简单" << endl; break; case 2: cout << "你选择的是中等" << endl; break; case 3: cout << "你选择的是困难" << endl; break; } system("pause"); return 0; }3、
#include<iostream>
using namespace std; int main() { for (int i = 0; i < 10; i++) { for (int j = 0; j < 10; j++) { if (j == 5) { break; } cout << 1; } cout << endl; } system("pause"); return 0; }4、
#include<iostream>
using namespace std; int main() { for (int i = 0; i <= 100; i++) { if (i % 2 == 0) { continue; } cout << i << endl; } system("pause"); return 0; } 5、#include<iostream>
using namespace std; int main() { cout << 1 << endl; cout << 2 << endl; cout << 3 << endl; goto A; cout << 4 << endl; A: cout << 5 << endl; system("pause"); return 0; }6、
#include<iostream>
using namespace std; int main() { int arr[4]; arr[0] = 1; arr[1] = 2; arr[2] = 3; arr[3] = 4; int arr2[4] = { 1,2,3,4 }; int arr3[] = { 1,2,3,4 }; for (int i = 0; i < 4; i++) { cout << arr[i] << endl; } cout << sizeof(arr) << endl; cout << sizeof(arr[1]) << endl; cout << arr << endl; cout << (int)arr << endl; cout << &arr[1] << endl; cout << (int)&arr[1] << endl; system("pause"); return 0; }7、
#include<iostream>
using namespace std; int main() { int max = 0; int arr[] = { 300,350,200,450,250 }; for (int i = 0; i < 5; i++) { if (arr[i] > max) { max = arr[i]; } } cout << max << endl; system("pause"); return 0; }转载地址:https://blog.csdn.net/zhizhikaodigua/article/details/121235521 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!
发表评论
最新留言
不错!
[***.144.177.141]2024年04月22日 16时12分26秒
关于作者
喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!
推荐文章
如何使用Python的进度条?
2019-04-27
如何利用情感词典做中文文本的情感分析?
2019-04-27
【青少年编程】【Scratch】06 侦测模块
2019-04-27
【直播】李祖贤:集成学习答疑直播之八-- 集成知识点回顾与补充
2019-04-27
Datawhale组队学习周报(第013周)
2019-04-27
如何设置matplotlib中x,y坐标轴的位置?
2019-04-27
【第15周复盘】B站是个学习的网站
2019-04-27
黄家懿:河北高校邀请赛 -- 二手车交易价格预测决赛答辩
2019-04-27
如何利用pyecharts绘制酷炫的桑基图?
2019-04-27
王朝阳:河北高校邀请赛 -- 二手车交易价格预测决赛答辩
2019-04-27
Scratch等级考试(二级)模拟题
2019-04-27
如何在Jupyter Lab中显示pyecharts的图形?
2019-04-27
什么是Python之禅?
2019-04-27
【青少年编程】【Scratch】01 运动模块
2019-04-27
json的序列化与反序列化
2019-04-27
【第16周复盘】学习的飞轮
2019-04-27
如何利用pyecharts绘制炫酷的关系网络图?
2019-04-27
NCEPU:线下组队学习周报(007)
2019-04-27
【青少年编程】【二级】寻找宝石
2019-04-27
【组队学习】【26期】Linux教程
2019-04-27