牛客305146746号
牛客305146746号
全部文章
题解
归档
标签
去牛客网
登录
/
注册
牛客305146746号的博客
全部文章
/ 题解
(共48篇)
题解 | #字符串反转#
#include <stdio.h> #include <string.h> int main() { char str[1000] = {0}; scanf("%s", str); int len = strlen(str); char *...
C
2022-05-31
0
285
题解 | #数字颠倒#
//取整数的每一位可用% #include <stdio.h> int main() { int num = 0; char str[32] = {0}; int i = 0; if(scanf("%d", &num)) { ...
C
2022-05-31
0
299
题解 | #质数因子#
#include <stdio.h> /* 1、输入的数字必须大于1. 2、最小的质数是2.能被2整除的数,同样能被2的倍数整除。 3、最后num不能被别的数整除,说明就是质数,要打印出来 / int main() { unsigned int num = 0; if(scanf("%d...
C
2022-05-30
0
318
题解 | #进制转换#
#include <stdio.h> int main() { char str[128] = {0}; int out = 0; int num = -1; while(gets(str)) //输入0XAB { //str[0] = '0' str[1] = 'X' str[2] ...
C
2022-05-30
1
433
题解 | #字符串分隔#
#include <stdio.h> #include <string.h> int main() { char str[100] = {0}; gets(str); int len = strlen(str); int num = len / 8; //取整,实际循环次数为...
C
2022-05-29
0
324
题解 | #输入n个整数,输出其中最小的k个#
#include <stdio.h> #define CHARVALUE ('a' - 'A') //判断字符大小写,小写返回0,大写返回1 int parsechar(char c) { if(c >= 'a' && c <= 'z' || c >= ...
C
2022-05-29
0
259
题解 | #输入n个整数,输出其中最小的k个#
#include <stdio.h> #include <stdlib.h> int cmp_asc(int *a, int *b) { return *a - *b; } int cmp_desc(int *a, int *b) { return *b - *a; } in...
C
2022-05-29
0
304
题解 | #输入n个整数,输出其中最小的k个#
#include <stdio.h> #include <stdlib.h> int ascending(int *a, int *b) { return *a - *b; //升序(从小到大) //return *b - *a //降序 } in...
C
2022-05-29
0
392
首页
上一页
1
2
3
4
5
下一页
末页