标签:algorithm get read name string define register amp lan
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
#include <cstdlib>
#include <string>
#include <fstream>
using namespace std;
#define LL long long
#define R register
inline int read() {
int x = 0, f = 1; char a = getchar();
for(; a > ‘9‘ || a < ‘0‘; a = getchar()) if(a == ‘-‘) f = -1;
for(; a >= ‘0‘ && a <= ‘9‘ ; a = getchar()) x = x * 10 + a - ‘0‘;
return x * f;
}
int main() {
system("g++ -o circle circle.cpp");
int sum = 0, ms = 100 / 20;
for(R int i = 1; i <= 20; i ++) {
string s = "circle";
if(i < 10) {
s += char(i%10 + ‘0‘);
}
else {
s += char(i / 10 + ‘0‘);
s += char(i%10 + ‘0‘);
}
s += ".in";
ifstream fin(s);
ofstream fout("circle.in");
string ts;
while(fin >> ts) fout<< ts << endl;
system("./circle");
s = "circle";
if(i < 10) {
s += char(i%10 + ‘0‘);
}
else {
s += char(i / 10 + ‘0‘);
s += char(i%10 + ‘0‘);
}
s += ".out";
ifstream fin1(s), fin2("circle.out");
string s1, s2;
int f = 1;
while(fin1 >> s1) { fin2 >> s2; if(s1 != s2) {f = 0;break; }}
if(f)
printf("\033[0;32;40m Case %d: Accept!\n", i), sum += ms;
else printf("\033[0;31;40m Case %d: Warning!\n", i);
}
printf("Your mark : %d\n", sum);
}
标签:algorithm get read name string define register amp lan
原文地址:https://www.cnblogs.com/HN-wrp/p/13153908.html