摘要:
//StringBuilder class //java.lang.StringBuilder //methods: .append() .toString() // import java.util.Scanner; public class StrBuilder { public static 阅读全文
posted @ 2020-06-09 14:52
profesor
阅读(591)评论(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
阅读(354)评论(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
阅读(223)评论(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
阅读(147)评论(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
阅读(94)评论(0)推荐(0)
摘要:
#include <stdio.h> #include <string.h> struct Person { char name[24]; char character[30]; int age; struct Birthday { int day; char month[10]; int year 阅读全文
posted @ 2020-06-05 22:23
profesor
阅读(198)评论(0)推荐(0)
摘要:
JAVA public class BooksTest { public static void main(String[] args) { int i; for (i = 0; i < args.length; i++) { System.out.printf("args[%d] = %s\n", 阅读全文
posted @ 2020-06-05 20:40
profesor
阅读(294)评论(0)推荐(0)