摘要: #include "stdafx.h" #include "iostream" #include "string" using namespace std; int main() { int n; do { cin>>n; } while(n==1);//条件为FALSE时,执行后面的语句 { co 阅读全文
posted @ 2020-05-21 11:12 财盛 阅读(479) 评论(0) 推荐(0) 编辑
摘要: #include "stdafx.h" #include "iostream" #include "string" using namespace std; void count();//函数原形 int main() { count(); } void count() { string a="ab 阅读全文
posted @ 2020-05-21 11:11 财盛 阅读(175) 评论(0) 推荐(0) 编辑
摘要: 2018年初赛奥赛题(8分): 代码: #include "stdafx.h" #include <cstdio> int main() { int x; scanf_s("%d",&x); int res=0; for(int i=0;i<x;++i) { if (i*i%x==1) {++res 阅读全文
posted @ 2020-05-21 11:09 财盛 阅读(222) 评论(0) 推荐(0) 编辑
摘要: 2018年初赛奥赛题(8分): 代码: #include "stdafx.h" #include <cstdio> char st[100]; int main() { cin>>st; for(int i=0;st[i];++i) { if('A'<=st[i] && st[i]<='Z') st 阅读全文
posted @ 2020-05-21 10:56 财盛 阅读(393) 评论(0) 推荐(0) 编辑
摘要: 2018初赛奥赛题(5分): 甲乙丙丁四人在考虑周末要不要外出郊游。已知1、如果周末下雨,并且乙不去,则甲一定不去;2、如果乙去,则丁一定去;3、如果丙去,则丁一定不去;4、如果丁不去,而且甲不去,则丙一定不去。如果周末丙去了,则甲 (去了/没去),乙 (去了/没去),丁 (去了/没去),周末 (下 阅读全文
posted @ 2020-05-21 10:54 财盛 阅读(578) 评论(0) 推荐(0) 编辑
摘要: 题目1: 输入一个介于0-100之间的整数,求其中含几个5? 思路: #include "stdafx.h" #include "iostream" #include "cstring" #include "string" using namespace std; int main() { int 阅读全文
posted @ 2020-05-21 10:52 财盛 阅读(237) 评论(0) 推荐(0) 编辑
摘要: 题目: #include "stdafx.h" #include "iostream" #include "cstring" #include "string" using namespace std; int a; int box; int main() { int n,s=0; cin>>n; 阅读全文
posted @ 2020-05-21 10:38 财盛 阅读(92) 评论(0) 推荐(0) 编辑
摘要: 2018奥赛初赛题(5) 题目: 从1到2018这2018个数中,共有 544 个包含数字8的数。含数字8的数是指某一位是“8”的数,例如“2018”与“188。” 解题思路: A方案: 将这2018个数字分别变成字符串,然后在每个字符串中,用find()方法找"8"(即看这个数是否含有"8",找到 阅读全文
posted @ 2020-05-21 10:28 财盛 阅读(859) 评论(0) 推荐(0) 编辑
摘要: #include "stdafx.h" #include "iostream" #include "string" using namespace std; int main() { int line=0; char ch; while (cin.get(ch)) { if(ch=='Q'){bre 阅读全文
posted @ 2020-05-21 10:20 财盛 阅读(98) 评论(0) 推荐(0) 编辑
摘要: 要求:对70开方,保留到小数后1位。 #include "stdafx.h" #include "iostream" #include "string"#include "iomanip" using namespace std; int main() { int a=70; double b=0; 阅读全文
posted @ 2020-05-21 10:18 财盛 阅读(255) 评论(0) 推荐(0) 编辑
摘要: #include "stdafx.h" #include "iostream" #include "cmath" using namespace std; struct polar {double distance;double angle;}; struct rect {double x;doub 阅读全文
posted @ 2020-05-21 10:16 财盛 阅读(146) 评论(0) 推荐(0) 编辑
摘要: 代码部分: #include "stdafx.h" #include "iostream" struct travel_time {int hours;int mins;}; const int Mins_per_hr=60; travel_time sum( travel_time t1,trav 阅读全文
posted @ 2020-05-21 10:14 财盛 阅读(157) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2020-05-21 10:04 财盛 阅读(226) 评论(0) 推荐(0) 编辑
摘要: #include "stdafx.h" #include "iostream" #include "string" using namespace std; int main() { string pwd="a123"; string n=""; int j=1; do { cout<<"请第"<< 阅读全文
posted @ 2020-05-21 08:45 财盛 阅读(641) 评论(0) 推荐(0) 编辑
摘要: #include "stdafx.h" #include "cstdio" #include "iostream" #include "algorithm" using namespace std; int main() { char grade='A'; switch(grade) { case 阅读全文
posted @ 2020-05-21 08:44 财盛 阅读(316) 评论(0) 推荐(0) 编辑
摘要: #include "stdafx.h" #include "cstdio" #include "iostream" #include "algorithm" using namespace std; int main() { string grade="A"; if (grade=="A") cou 阅读全文
posted @ 2020-05-21 08:43 财盛 阅读(529) 评论(0) 推荐(0) 编辑
摘要: #include "stdafx.h" #include "iostream" #include "cstring" #include "string" using namespace std; int a,b,c,d; int main() {for (c=0;c>=0;c++) //此处可用替换 阅读全文
posted @ 2020-05-21 08:35 财盛 阅读(1716) 评论(0) 推荐(0) 编辑
摘要: #include "stdafx.h" #include "iostream" #include "cstring" #include "string" using namespace std; int a,b,c,d,e,f; int main() {cin>>a; cin>>b; cin>>c; 阅读全文
posted @ 2020-05-21 08:34 财盛 阅读(106) 评论(0) 推荐(0) 编辑
摘要: #include "stdafx.h" #include "iostream" #include "cstring" #include "string" void oil(int x); using namespace std; int main() { int texas=31; int year 阅读全文
posted @ 2020-05-21 08:32 财盛 阅读(129) 评论(0) 推荐(0) 编辑
摘要: #include "stdafx.h" #include "iostream" #include "cstring" #include "string" using namespace std; struct job { char name[40]; double salary; int floor 阅读全文
posted @ 2020-05-21 08:26 财盛 阅读(128) 评论(0) 推荐(0) 编辑