Coder

舒心、快乐,比什么都重要

摘要: #include #include using namespace std; int main(){ int index, arr[10] = {0}; string num; // 一千位的数字很大所以要用字符串进行转化 getline(cin, num); for (int i = 0; i < num.size(); i++){ in... 阅读全文
posted @ 2019-04-16 23:15 H123K 阅读(86) 评论(0) 推荐(0) 编辑
摘要: #include #include #include using namespace std; int main(){ double sum4 = 0.0; int n, t, k = -1, cnt = 0, cnt2 = 0, max = 0, sum1 = 0, sum2 = 0, sum3 = 0; cin >> n; while (n--){ ... 阅读全文
posted @ 2019-04-16 22:53 H123K 阅读(172) 评论(0) 推荐(0) 编辑
摘要: #include using namespace std; int main(){ int t; cin >> t; double a, b, c; // 因为int最大是2^31的数字,所以要用double 这个很重要 for (int i = 1; i > a >> b >> c; if (a + b > c) c... 阅读全文
posted @ 2019-04-16 21:53 H123K 阅读(134) 评论(0) 推荐(0) 编辑
摘要: #include #include #include using namespace std; int main(){ stacks; string str, stu = ""; //制造空字符串 getline(cin, str); for (int i = 0; i < str.size(); i++) { // 通过间接法将一个字符串转入另一个字... 阅读全文
posted @ 2019-04-16 21:26 H123K 阅读(123) 评论(0) 推荐(0) 编辑
摘要: #include #include #include using namespace std; int main(){ int n, m; cin >> n >> m; int *p = new int[n]; for (int i = 0; i > p[i]; m = m % n; reverse(p, p + n - m); // 算法... 阅读全文
posted @ 2019-04-16 01:41 H123K 阅读(83) 评论(0) 推荐(0) 编辑
摘要: 第一个方法: #include #include using namespace std; int main(){ int n, h, t, o; cin >> n; h = n / 100; // 对于每位数的求解不能出错 t = n / 10 % 10; o = n % 100 % 10; if (h != 0){ // 要使用连续的是那... 阅读全文
posted @ 2019-04-16 00:32 H123K 阅读(181) 评论(0) 推荐(0) 编辑
摘要: #include using namespace std; struct Stu { int score; string id, num; }stu; int main(){ string s1 ,s2 , s3, s4; int n, max = 0, min = 110; cin >> n; while (n--) { cin... 阅读全文
posted @ 2019-04-16 00:03 H123K 阅读(106) 评论(0) 推荐(0) 编辑