摘要:
001、 root@PC1:/home/test3# ls a.txt test.py root@PC1:/home/test3# cat test.py ## 测试程序 #!/usr/bin/python in_file = open("a.txt", "r") lines = in_file.r 阅读全文
摘要:
001、 >>> "{0}".format("xxx") ## 位置参数 'xxx' >>> "{0}.{1}.{2}".format("xxx", "yyy", "zzz") 'xxx.yyy.zzz' >>> "\t{0}.{1}.{2}".format("xxx", "yyy", "zzz") 阅读全文
摘要:
001、 #include <stdio.h> int main(void) { int i; int result = 0; printf("i = "); scanf("%d", &i); while(i > 0) { result = result * 10 + i % 10; i /= 10 阅读全文
摘要:
001、 在函数定义中, 形参名不能和函数内部的变量同名, 否则会发生冲突。 002、 定义不同函数时, 可以使用不能的形参名, 因为虽然同名,但是分别属于不同的函数。 003、 在函数调用过程中, 实参可以和形参同名, 因为实参不属于调用函数的部分。 阅读全文
摘要:
001、 #include <stdio.h> //以下为函数定义 int max2(int a, int b) // 该句称为函数头;int 表示函数返回类型; max2表示函数名; int a 和int b为形参声明。 { if(a > b) return a; //此处花括号内为函数体 els 阅读全文
摘要:
001、 元素为数组的数组: 二维数据 #include <stdio.h> int main(void) { int i, j; int tensu1[4][3] = {{91, 63, 78}, {67, 72, 46}, {89, 34, 53}, {32, 54, 34}}; int ten 阅读全文