摘要: 1 #define _CRT_SECURE_NO_WARNINGS 2 #include <stdio.h> 3 #include <stdlib.h> 4 5 int main(){ 6 int a, b; 7 int max; 8 scanf("%d%d", &a, &b); 9 int sma 阅读全文
posted @ 2020-04-08 20:24 听说在北郭 阅读(171) 评论(0) 推荐(0)
摘要: #define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include <stdlib.h> int main(){ int a, b; scanf("%d%d", &a, &b); int bigger = a * b; int i; for (i 阅读全文
posted @ 2020-04-08 20:18 听说在北郭 阅读(104) 评论(0) 推荐(0)
摘要: #define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include <stdlib.h> #define MAX 1024 int main(){ /*char *p1[5] = { "让编程改变世界 -- 鱼C工作室", "Just do it 阅读全文
posted @ 2020-04-07 16:08 听说在北郭 阅读(134) 评论(0) 推荐(0)
摘要: 1 #define _CRT_SECURE_NO_WARNINGS 2 #include <stdio.h> 3 #include <stdlib.h> 4 #define MAX 1024 5 6 int main(){ 7 //用指针打印字符串长度 8 char str[MAX]; 9 char 阅读全文
posted @ 2020-04-05 19:14 听说在北郭 阅读(459) 评论(0) 推荐(0)
摘要: 1 #define _CRT_SECURE_NO_WARNINGS 2 #include <stdio.h> 3 #include <stdlib.h> 4 5 int main(){ 6 8 //验证尼科彻斯定理:任何一个大于 2 的整数的立方都可以表示成一串连续奇数的和,这些奇数一定是要连续的( 阅读全文
posted @ 2020-04-05 17:58 听说在北郭 阅读(393) 评论(0) 推荐(0)
摘要: #define _CRT_SECURE_NO_WARNINGS#include <stdio.h>#include <stdlib.h> int main(){ //从小到大排列数字 int a = 0; int b = 0; int c = 0; int t; int *d, *e, *f; pr 阅读全文
posted @ 2020-04-04 20:32 听说在北郭 阅读(123) 评论(0) 推荐(0)
摘要: 法一: #include <stdio.h>#include <stdlib.h> //打印数组中只出现了一次的数字int Func(int arr[], int size){ int numCount[100] = { 0 }; for (int i = 0; i < size; i++){ nu 阅读全文
posted @ 2020-04-03 15:35 听说在北郭 阅读(264) 评论(0) 推荐(0)
摘要: #include <stdio.h>#include <stdlib.h> //输入一个数,打印它的每一位 void printnum(int n){ if (n <= 0){ return; } printf("%d\n", n % 10); // 倒序打印,因为在出递归前打印的 //交换上下两行 阅读全文
posted @ 2020-04-02 14:54 听说在北郭 阅读(245) 评论(0) 推荐(0)
摘要: #include <stdio.h>#include <stdlib.h> //使用递归函数DigitSum(n),输入非负整数, 返回组成它的数字之和//DigitSum(9527),则返回 sum = 9 + 5 + 2 + 7//a = n % 10 + a / 10int DigitSum( 阅读全文
posted @ 2020-04-02 14:38 听说在北郭 阅读(395) 评论(0) 推荐(0)
摘要: #include <stdio.h>#include <stdlib.h> //写一个函数返回二进制中1的个数(法1:数位遍历)int countOneNum(int n){ int i; int count = 0; for (i = n; i; i /= 2){ count += i % 2;  阅读全文
posted @ 2020-04-02 13:13 听说在北郭 阅读(375) 评论(0) 推荐(0)