- 博客(7)
- 收藏
- 关注
原创 【无标题】
#include <iostream>#include <iomanip>using namespace std;class Rational{private: signed int x; signed int y;public: Rational() { x = 0; y = 1; } void Add(int a, int b,int c,int d) { x = (a * d) + (c * b); y = b * d; } voi
2021-12-17 16:13:22 238
原创 判断是数字还是英文字母
#include <iostream>using namespace std;int main(){ char a; cin >> a; for (; a >= 'A' && a <= 'Z';) { cout << "char"; exit(1); } for (; a >= 'a' && a <= 'z';) { cout << "char"; exit(1); }
2021-11-11 22:49:57 83
原创 这一天是这一年的第几天?
#include <iostream>using namespace std;int fun( int m,int y ){ int d; switch (m) { case 1:case 3:case 5:case 7:case 8:case 10:case 12: d = 31; break; case 4:case 6:case 9:case 11: d = 30; break; case 2:if ((y % 4 == 0) && (y % 10
2021-11-11 22:23:59 69
原创 2021-10-19字符型与整型互换
#include <iostream>using namespace std;int main(){ char b; int a, c; cin >> b; a = (int)b - 1; c = (int)b + 1; cout << (char)a << " " << (char)c;}
2021-10-19 17:20:25 92
原创 2021-10-18取一个数的前1、2、3位
#include <iostream>using namespace std;int main(){ int x, a, b, c; cin >> x; a = x / 100; b = x % 100 /10; c = x % 10; if (x == ((a *a*a) + (b*b*b) + (c*c*c))) {cout << "yes"<<endl;} else { cout << "no"<<end
2021-10-18 18:46:31 417
原创 2021-10-18
#include <iostream>using namespace std;int main(){ int time1, time2, t1, t2, h, m; cin >> time1 >> time2; t1 = (time1 / 100) * 60 + (time1 % 100); t2 = (time2 / 100) * 60 + (time2 % 100); h = (t2 - t1) / 60; m = (t2 - t1) % 60;
2021-10-18 14:52:43 36
原创 2021-10-17
#include <iostream>using namespace std;int main() { cout << " ##### " <<endl ; cout << "# #" << endl; cout << "# #" << endl; cout << " ##### " << endl; cout << "# #" << e
2021-10-17 18:04:21 44
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人