上一页 1 ··· 63 64 65 66 67 68 69 70 71 ··· 79 下一页
摘要: #include<stdio.h> void p1() { printf("******************\n"); } void p2() { printf("一起学习C语言函数呀!\n"); } int main() { p1(); p2(); p1(); return 0; } 例题中p 阅读全文
posted @ 2019-11-29 10:41 木子欢儿 阅读(4608) 评论(0) 推荐(0) 编辑
摘要: 原理: 这类题目主要通过ASCII(美国信息交换标准代码)码差值实现,A对应ASCII码十进制数字是65,a对应ASCII码十进制数字是97,即大小写字母之间ASCII码差值为32,想要将大写字母转换为小写字母可以将该字符ASCII码值+32,同理小写字母转换成大写字母只需将该字符ASCII码值-3 阅读全文
posted @ 2019-11-29 07:47 木子欢儿 阅读(4660) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h> int main() { int a[5],i; printf("请输入5个整数:\n"); for(i=0;i<5;i++) scanf("%d",&a[i]); printf("逆序为:\n"); for(i=4;i>=0;i--) printf("%d\n 阅读全文
posted @ 2019-11-28 07:40 木子欢儿 阅读(4495) 评论(0) 推荐(0) 编辑
摘要: 先判断后转化 原理: 这类题目主要通过ASCII(美国信息交换标准代码)码差值实现,A对应ASCII码十进制数字是65,a对应ASCII码十进制数字是97,即大小写字母之间ASCII码差值为32,想要将大写字母转换为小写字母可以将该字符ASCII码值+32,同理小写字母转换成大写字母只需将该字符AS 阅读全文
posted @ 2019-11-27 20:48 木子欢儿 阅读(8599) 评论(0) 推荐(0) 编辑
摘要: 什么是完数? 如果一个数等于它的因子之和,则称该数为“完数”(或“完全数”)。 例如,6的因子为1、2、3,而 6=1+2+3,因此6是“完数”。 问题分析 根据完数的定义,解决本题的关键是计算出所选取的整数m(m的取值范围不固定)的因子(因子就是所有可以整除这个数的数),将各因子累加到变量sum 阅读全文
posted @ 2019-11-27 18:54 木子欢儿 阅读(4558) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h> void fun(int *x,int*y) { int t; if(*x>=*y) { t=*x;*x=*y;*y=t; } } main() { int m,n; printf("请输入2个数字\n"); scanf("%d%d",&m,&n); fun(& 阅读全文
posted @ 2019-11-27 17:10 木子欢儿 阅读(482) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h> int fun(int x) { int n; for(n=2;n<=x-1;n++) if(x%n==0) break; if(n>=x) return 1; else return 0; } main() { int m; for(m=2;m<1000;m+ 阅读全文
posted @ 2019-11-27 17:02 木子欢儿 阅读(2234) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h> int fun(int x) { int a, b, c; a = x / 100; b = x % 100 / 10; c = x % 10; if (x == a * a * a + b * b * b + c * c * c) return 1; else 阅读全文
posted @ 2019-11-27 16:55 木子欢儿 阅读(2665) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h> int max(int x,int y,int z) { if(x>=y) if(x>=z) return x; else return z; else if(y>=z) return y; else return z; } main() { int a,b,c 阅读全文
posted @ 2019-11-27 16:06 木子欢儿 阅读(2979) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h> int max(int x,int y) { if(x>=y) return x; else return y; } main() { int a,b; printf("请输入2个数字:\n"); scanf("%d%d",&a,&b); printf("最大值 阅读全文
posted @ 2019-11-27 15:59 木子欢儿 阅读(1272) 评论(0) 推荐(0) 编辑
上一页 1 ··· 63 64 65 66 67 68 69 70 71 ··· 79 下一页