上一页 1 ··· 4 5 6 7 8 9 下一页
摘要: Python 分析 因为前面两字符串中第 1 对相同的大写英文字母(大小写有区分)是第 4 个字母 D,代表星期四 所以这句话注意的点是: 1.第一对相同 2.大写英文字母 3.一周只有七天,所以大写英文字母的范围是A-G,不是A-Z; 第 2 对相同的字符是 E ,那是第 5 个英文字母,代表一天 阅读全文
posted @ 2020-07-02 01:09 上帝的绵羊 阅读(430) 评论(0) 推荐(0) 编辑
摘要: 今天这个题的输出形式很坑爹,难度到是没多大 C++实现(C直接改一改输入输出就行): 1 #include<iostream> 2 #include<cmath> 3 4 using namespace std; 5 6 /*判断素数(利用平方根的方法判断)*/ 7 bool isprime(int 阅读全文
posted @ 2020-07-01 01:18 上帝的绵羊 阅读(250) 评论(0) 推荐(0) 编辑
摘要: 很奇怪啊,测试点7一直无法通过 测试点8若无法通过,原因可能是没有考虑A2可能为0情况(进行过A2的计算,但和初始化0重复),利用标志位进行解决 1 #include<iostream> 2 #include<vector> 3 #include<cmath> 4 #include<iomanip> 阅读全文
posted @ 2020-06-30 00:37 上帝的绵羊 阅读(542) 评论(0) 推荐(0) 编辑
摘要: 今日的简单一题 1 #include<iostream> 2 3 using namespace std; 4 5 int main() { 6 long a = 0, b = 0, c = 0; 7 int n = 0; 8 string judge[10]; 9 cin >> n; 10 for 阅读全文
posted @ 2020-06-28 21:10 上帝的绵羊 阅读(160) 评论(0) 推荐(0) 编辑
摘要: 今天的题虽然简单,但是有个细节一定要注意,先放代码: 1 #include<iostream> 2 #include<vector> 3 using namespace std; 4 5 int main() { 6 int n = 0; 7 vector<int> num; //vector动态处 阅读全文
posted @ 2020-06-28 01:35 上帝的绵羊 阅读(139) 评论(0) 推荐(0) 编辑
摘要: Python 首先想到的是用py去做,字符串获取后用split直接分割,分割后输出就行,没有难度 1 s = input() 2 word = s.split(" ") 3 word.reverse() 4 print(" ".join(word)) 缺点就是速度慢,占内存,做OJ题都这样吧 C++ 阅读全文
posted @ 2020-06-26 21:36 上帝的绵羊 阅读(204) 评论(0) 推荐(0) 编辑
摘要: 用C语言写的,逐个移动每一位的位置实现右移 C语言 1 #include<stdio.h> 2 3 void swap(int* n, int count,int num) { 4 int tmp = 0; 5 int i = 0; 6 int j = count - 2; 7 for (i = 0 阅读全文
posted @ 2020-06-26 01:49 上帝的绵羊 阅读(201) 评论(0) 推荐(1) 编辑
摘要: C++(C改一改输入输出即可) 1 #include<iostream> 2 #include <cmath> 3 using namespace std; 4 5 bool isprime(int i) { 6 for (int j = 2; j <= sqrt(i); ++j) { 7 if ( 阅读全文
posted @ 2020-06-25 03:44 上帝的绵羊 阅读(151) 评论(0) 推荐(0) 编辑
摘要: C/C++ 1 #include<iostream> 2 using namespace std; 3 4 int main() { 5 int n = 0; 6 cin >> n; 7 int b = n / 100; 8 int s = n / 10 % 10; 9 int g = n % 10 阅读全文
posted @ 2020-06-25 03:38 上帝的绵羊 阅读(164) 评论(0) 推荐(0) 编辑
摘要: C++ 1 #include <iostream> 2 #include <vector> 3 #include <algorithm> 4 using namespace std; 5 bool cmp(int a, int b) { 6 return a > b; 7 } 8 int main( 阅读全文
posted @ 2020-06-25 03:35 上帝的绵羊 阅读(157) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8 9 下一页