SNOWSD

导航

随笔分类 -  c语言学习路程

c语言学习路程——前n项求和
摘要:1 #include <stdio.h> 2 3 int main() { 4 int n; 5 double dividend, divisor; 6 double sum = 0.0; 7 int i; 8 double t; 9 10 scanf_s("%d", &n); 11 12 divi 阅读全文

posted @ 2021-01-09 16:01 SNOWSD 阅读(814) 评论(0) 推荐(0)

c语言学习路程——1~100的素数和
摘要:#include <stdio.h> int main() { int m, n; int i; int count = 0; int sum = 0; scanf_s("%d %d", &m, &n); for (int i = m; i <= n; i++) { int isPrime = 1; 阅读全文

posted @ 2021-01-09 14:13 SNOWSD 阅读(795) 评论(0) 推荐(0)

c语言学习历程——给定条件的整数集
摘要:1 #include <stdio.h> 2 3 4 int main() { 5 int a; 6 int i, j, k; 7 int count = 0; 8 9 scanf_s("%d", &a); 10 11 i = a; 12 13 while (i <= a + 3) { 14 j = 阅读全文

posted @ 2021-01-08 23:18 SNOWSD 阅读(178) 评论(0) 推荐(0)

c语言学习路程——最大公约数
摘要:1 #include <stdio.h> 2 3 4 int main() { 5 6 int a = 0; 7 int b = 0; 8 int count=0; 9 scanf_s("%d", &a); 10 scanf_s("%d", &b); 11 while (b != 0) { 12 i 阅读全文

posted @ 2021-01-08 22:40 SNOWSD 阅读(75) 评论(0) 推荐(0)

c语言的学习路程———整数分解
摘要:#include<stdio.h> int main() { int a; scanf_s("%d", &a); int x = a; int count = 0; int mask = 1; while (a > 9) { a /= 10; mask *= 10; count++; } print 阅读全文

posted @ 2021-01-08 20:17 SNOWSD 阅读(230) 评论(0) 推荐(0)