Green1127

C++代码存放设施 site - 01 所有UTF-8已同步

博客园 首页 新随笔 联系 订阅 管理

2023年12月9日 #

摘要: 函数 字符相关函数 ● isupper():判断一个字符是否是大写字母 ● islower():判断一个字符是否是小写字母 ● isalpha():判断一个字符是否是字母 ● isdigit():判断一个字符是否是数字字符 ● isalnum():判断一个字符是否是数字或字母 字符相关转换函数 ● 阅读全文
posted @ 2023-12-09 18:30 Green_wang 阅读(35) 评论(0) 推荐(0)

2023年12月8日 #

摘要: int _sum(int m){ int x = 0; while (m){ x += m % 10; m /= 10; cnt ++; } return x; } 阅读全文
posted @ 2023-12-08 20:20 Green_wang 阅读(14) 评论(0) 推荐(0)

2023年12月7日 #

摘要: int reverse(int x){ int ans = 0; while (x){ ans *= 10; ans += x % 10; x /= 10; } return ans; } 阅读全文
posted @ 2023-12-07 21:29 Green_wang 阅读(19) 评论(0) 推荐(0)

摘要: 直接封装函数返回string string dec_bin(long long x){ string s = ""; while(x > 0){ int yu = x % 2; s = char(yu + '0') + s; x /= 2; } return s; } 阅读全文
posted @ 2023-12-07 20:12 Green_wang 阅读(18) 评论(0) 推荐(0)

2023年12月6日 #

摘要: 通用,一键CV可用 bool prime(int x){ if(x == 1) return false; if(x == 2) return true; for (int i = 2; i * i <= x; i++){ if (x % i == 0) return false; } return 阅读全文
posted @ 2023-12-06 19:14 Green_wang 阅读(28) 评论(0) 推荐(0)