#include<bits/stdc++.h> intmain() { struct_timeb T; _ftime(&T); srand(T.millitm); //获得毫秒 int a = rand(); printf("%d\n", a); }
对拍
eg: A+B problem 正确代码(需要验证的代码) std.cpp
1 2 3 4 5 6 7 8 9
#include<cstdio> usingnamespace std; intmain() { int a, b; scanf("%d%d", &a, &b); printf("%d\n", a + b); return0; }
暴力代码:baoli.cpp
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
#include<cstdio> usingnamespace std; intmain() { int a, b; scanf("%d%d", &a, &b); int ans = 0; int i; for (i = 1; i <= a; i++) ans++; for (i = 1; i <= b; i++) ans++; printf("%d\n", ans); return0; }