摘要: #!/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 阅读(135) 评论(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 阅读(399) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h> void minmax(int a[], int *min, int *max, int len); //函数声明 int main() { int b[] = {1, 2, 4, 7, 10, 15, 17, 20, 100, 90, -1, 1000, 20 阅读全文
posted @ 2020-04-30 22:18 profesor 阅读(203) 评论(0) 推荐(0) 编辑
摘要: Fibonacci series 输出斐波那契数列前30个数,每行打印5个数 #include <stdio.h> #define MAX 30 int main() { int fib[MAX] = {1,1}; for (int i=2; i<MAX; i++) { fib[i] = fib[i 阅读全文
posted @ 2020-04-30 21:08 profesor 阅读(2160) 评论(0) 推荐(1) 编辑
摘要: 找出一维数组中最大最小的数 #include <stdio.h> //找出一维数组中最大最小的数 int main() { int a[] = {1, 2, 4, 7, 10, 15, 17, 20, 100, 90, -1, 1000, 20001, -99}; printf("%p\n", &a 阅读全文
posted @ 2020-04-30 20:13 profesor 阅读(343) 评论(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 阅读(2164) 评论(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 阅读(385) 评论(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 阅读(193) 评论(0) 推荐(0) 编辑
摘要: https://www.python.org/dev/peps/pep-0263/ # coding=<encoding name> 阅读全文
posted @ 2020-04-27 16:13 profesor 阅读(81) 评论(0) 推荐(0) 编辑
摘要: Python is becoming the world’s most popular coding language But its rivals are unlikely to disappear Jul 26th 2018 “I CERTAINLY didn’t set out to crea 阅读全文
posted @ 2020-04-27 14:27 profesor 阅读(230) 评论(0) 推荐(0) 编辑