摘要: 题目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 财盛 阅读(238) 评论(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 财盛 阅读(930) 评论(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 财盛 阅读(256) 评论(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 财盛 阅读(158) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2020-05-21 10:04 财盛 阅读(227) 评论(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 财盛 阅读(642) 评论(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) 编辑