摘要:
#!/usr/bin/python3 print("hello, world!") name = 'Jerry' print(f"Hello, {name}, welcome back.") sum = 0 for i in range(1, 101): sum += i print(f"sum = 阅读全文
posted @ 2020-05-02 18:42
profesor
阅读(144)评论(0)推荐(0)
摘要:
C语言代码: #include <stdio.h> int main() { int i, j; i=j=1; for (i=1;i<10;i++) { for (j=1;j<=i;j++) { printf("%dx%d=%d", j, i, i*j); //注意j与i的顺序 if (i*j < 阅读全文
posted @ 2020-05-02 00:00
profesor
阅读(429)评论(0)推荐(0)
摘要:
调用函数,计算m~n之间所有整数的和 #include <stdio.h> int sum(int a, int b) { if (a <= b) { int sum = 0, i; for (i = a; i <= b; i++) { sum += i; } return sum; } else 阅读全文
posted @ 2020-04-30 12:17
profesor
阅读(2223)评论(0)推荐(0)
摘要:
输入两整数,找出最大的数 #include <stdio.h> int max(int a, int b); int main() { int a, b; scanf("%d%d", &a, &b); printf("%d与%d中的最大数为%d\n", a, b, max(a, b)); retur 阅读全文
posted @ 2020-04-30 12:04
profesor
阅读(400)评论(0)推荐(0)
摘要:
break下: #include <stdio.h> int main() { int x = 1, a = 0, b = 0; switch(x) { case 0: b++; break; case 1: a++; break; case 2: a++; b++; break; } printf 阅读全文
posted @ 2020-04-28 21:39
profesor
阅读(202)评论(0)推荐(0)