摘要:
//StringBuilder class //java.lang.StringBuilder //methods: .append() .toString() // import java.util.Scanner; public class StrBuilder { public static 阅读全文
posted @ 2020-06-09 14:52
profesor
阅读(580)评论(0)推荐(0)
摘要:
public class CharAt { public static void main(String[] args) { String ac = "Hello World"; //for (int i = 0; i < ac.length(); i++) int i = 0; //while ( 阅读全文
posted @ 2020-06-07 08:36
profesor
阅读(337)评论(0)推荐(0)
摘要:
计算阶乘 #include <stdio.h> double fact(int); int main() { int x; printf("input a positive integer (<20) to calculate its factorial: "); scanf("%d", &x); 阅读全文
posted @ 2020-06-06 21:47
profesor
阅读(213)评论(0)推荐(0)
摘要:
from functools import reduce i = int(input("input a number 1-10: ")) result = reduce(lambda a, b: a*b, [item for item in range(1,i+1)]) print(f'factor 阅读全文
posted @ 2020-06-06 20:57
profesor
阅读(128)评论(0)推荐(0)
摘要:
#include <stdio.h> int main() { int a = 0; while (a < 10){ printf("a is %d\n", a); if ( a == 5) goto OUT; a++; } OUT: printf("We're out of the loop.\n 阅读全文
posted @ 2020-06-06 07:56
profesor
阅读(82)评论(0)推荐(0)