摘要:
#include <iostream> using namespace std; int main() { //continue语句 //跳出本次循环 执行下次循环 for(int i=0;i<=10;i++) { //奇数输出偶数不输出 if(i % 2 == 0) { continue; } c 阅读全文
posted @ 2022-03-12 22:46
赵凤武
阅读(94)
评论(0)
推荐(0)
摘要:
1 #include <iostream> 2 using namespace std; 3 int main() { 4 //break使用时机 5 //1.出现在switch中 6 cout<<"请选择副本难度"<<endl; 7 cout<<"1.普通"<<endl; 8 cout<<"2.中 阅读全文
posted @ 2022-03-12 22:40
赵凤武
阅读(47)
评论(0)
推荐(0)
摘要:
1 #include <iostream> 2 using namespace std; 3 int main() { 4 //9X9 乘法口诀表 //列小于等于行数 5 // 1*1 6 // 1*2 2*2 7 // 1*3 2*3 3*3 8 for(int i=1;i<10;i++) 9 { 阅读全文
posted @ 2022-03-12 22:27
赵凤武
阅读(93)
评论(0)
推荐(0)
摘要:
1 #include <iostream> 2 using namespace std; 3 int main() { 4 //敲桌子 逢7 打印敲桌子 5 for(int i=1;i<=100;i++) 6 { 7 if(i%7==0) //7的倍数 8 { 9 cout<<i<<endl; 10 阅读全文
posted @ 2022-03-12 22:16
赵凤武
阅读(104)
评论(0)
推荐(0)
摘要:
#include <iostream> using namespace std; int main() { //三位水仙花数 例 1^3+5^3+3^3 = 153 int num=100; do{ int a=0,b=0,c=0; a = num % 10; //获取个位 b = num /10 阅读全文
posted @ 2022-03-12 22:05
赵凤武
阅读(63)
评论(0)
推荐(0)
摘要:
#include <iostream> #include <ctime> using namespace std; int main() { //猜数字1-100 //添加随机种子 srand((unsigned int)time(NULL)); int number = rand() % 100; 阅读全文
posted @ 2022-03-12 21:51
赵凤武
阅读(32)
评论(0)
推荐(0)
摘要:
#include <iostream> using namespace std; int main() { int a=10,b=20,c=0; c = (a>b?a:b); //a>b返回a 否则b cout<<c<<endl; (a>b?a:b) = 100; cout<<"a="<<a<<en 阅读全文
posted @ 2022-03-12 21:49
赵凤武
阅读(13)
评论(0)
推荐(0)
摘要:
1 #include <iostream> 2 3 using namespace std; 4 int main() { 5 //三只小猪比体重 6 int num1=0; 7 int num2=0; 8 int num3=0; 9 cout<<"请输入小猪a体重"<<endl; 10 cin>> 阅读全文
posted @ 2022-03-12 21:44
赵凤武
阅读(103)
评论(0)
推荐(0)

浙公网安备 33010602011771号