int a=1;
char* s[10];
int main() { int i, a[10]; for(i = 0; i < 10; ++i) a[i] = i * i; return 0; }
#include <stdio.h> int main() { int x = 0, y = 2; printf("%d, %d\n", x, y); return 0; }
#include <stdio.h> int main() { int a; scanf("%d", &a); if(a > 10) printf("too big"); else if(a < 0) printf("too small"); else printf("fine"); return 0; }
#include <stdio.h> int main() { int a; scanf("%d", &a); switch(a) { case 1: printf("hi\n"); break; case 2: printf("bye\n"); break; default: printf("go\n"); } return 0; }
#include <math.h> #include <stdio.h> double mcos(double x) {return cos(x);} int main() { int a; scanf("%d", &a); printf("%08.2lf\n", mcos((double)a)); return 0; }
int max(int a, int b) return a < b ? b : a;
if(a > b && (10 > 1 << i)) {a += 1;}
print("Input a, b:") scanf("%d, %d", &a, &b)
def main(): string = input("Please input a number:") print(int(string)) print(str(int(string))) if __name__ == "__main__": main()
Retranslate back from C to python line by line
from string import ascii_lowercase as lc, ascii_uppercase as uc shift = dict(list(zip(lc, lc[k:] + lc[:k])) + list(zip(uc, uc[k:] + uc[:k]))) str_ = ''.join([shift[c] for c in str_])
Retranslate back from C to python line by line
str2 = str1 print(str2[start:end])
markdown
文件pdf
文件