一个写得很shabi的differ

Posted HN-wrp

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了一个写得很shabi的differ相关的知识,希望对你有一定的参考价值。

#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);
}

以上是关于一个写得很shabi的differ的主要内容,如果未能解决你的问题,请参考以下文章

Client / Server Interoperability Support Matrix for Different Oracle Versions (Doc ID 207303.1)(代码片段

What's the difference between @Component, @Repository & @Service annotations in Spring?(代码片段

任何写得很好的 Facebook iOS SDK 教程?

day01 作业 三级菜单

这份数据分析报告规范,写得很棒!

Fuzzy C Means 算法及其 Python 实现——写得很清楚,见原文