摘要: //给定一个整数n(1<=n<=1000000000),要求从个位开始分离出它的每一位数字,从个位开始按照从低位到高位的顺序依次输出每一位数字(奥赛一本通p64 4题) //第一种解法 ,用到了stringstream,没用to_string,因为dev5.92版本不支持这个命令 # include 阅读全文
posted @ 2020-08-01 10:29 财盛 阅读(3105) 评论(0) 推荐(0) 编辑
摘要: # include <iostream># include <iomanip> //manipulator 操控者using namespace std;int main(){ int a,b; cin>>a>>b; int c=a/b; cout<<c<<endl; double e=a,f=b; 阅读全文
posted @ 2020-07-27 19:56 财盛 阅读(114) 评论(1) 推荐(0) 编辑
摘要: 举例: b=++a: a=1 ,++a后 a=2,b=2; b=a++: a=1,b=a所以b=1, a++后,a=2,b=1; 阅读全文
posted @ 2020-06-17 21:00 财盛 阅读(320) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> using namespace std; /* run this program using the console pauser or add your own getch, system("pause") or input loop */int jzj=0 阅读全文
posted @ 2020-06-04 07:34 财盛 阅读(291) 评论(0) 推荐(0) 编辑
摘要: //static.cpp-using a static local variable#include <iostream>using namespace std;//constants 常量const int ArSize=10;//function prototype 函数原型void strco 阅读全文
posted @ 2020-06-02 19:52 财盛 阅读(112) 评论(0) 推荐(0) 编辑
摘要: #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) 编辑