摘要: 1、c语言中switch语句 将程序分为多个分支的时候,可以使用switch语句。 #include <stdio.h> int main(void) { int i; puts("please input an integer."); printf("i = "); scanf("%d", &i) 阅读全文
posted @ 2021-03-13 23:02 小鲨鱼2018 阅读(681) 评论(0) 推荐(0) 编辑
摘要: 1、求两个数中的较大值 #include <stdio.h> int main(void) { int i,j,max; puts("please input two integers"); printf("i = "); scanf("%d", &i); printf("j = "); scanf 阅读全文
posted @ 2021-03-13 18:25 小鲨鱼2018 阅读(161) 评论(0) 推荐(0) 编辑
摘要: 1、 #include <stdio.h> int main(void) { int a, b; puts("please input two integer."); printf("a = "); scanf("%d", &a); printf("b = "); scanf("%d", &b); 阅读全文
posted @ 2021-03-13 14:29 小鲨鱼2018 阅读(1116) 评论(0) 推荐(0) 编辑
摘要: 1、 #include <stdio.h> int main(void) { double i, j; puts("please input two float type value."); printf("i = "); scanf("%lf", &i); ## double类型的变量通过scan 阅读全文
posted @ 2021-03-13 11:32 小鲨鱼2018 阅读(2091) 评论(0) 推荐(0) 编辑
摘要: 1、获取变量的最后一位数字 #include <stdio.h> int main(void) { int i; puts("please input an integer."); printf("i = "); scanf("%d", &i); printf("The last number of 阅读全文
posted @ 2021-03-13 10:23 小鲨鱼2018 阅读(3787) 评论(0) 推荐(0) 编辑