U E D R , A S I H C RSS

가위바위보/성재

~cpp 헤헤~  ..
힘 히 해  ~ ^-^
~ 힘~ !!!
 ... !

~cpp   ...
#include<iostream>
#include<fstream>
using namespace std;

int main()
{
	fstream fin;
	fin.open("data1.txt");
	char ch;
	char str;
	int win=0;
	int lose=0;
	int moo=0;
	while(fin.get(ch))
	{
		fin.get();
		fin.get(str);
		fin.get();
		
		switch(ch)
		{
		case '0':
			switch(str)
			{case '0':
				moo++;
				break;
			case '1':
				lose++;
				break;
			case '2':
				win++;
				break;}
			break;
		case '1':
			switch(str)
			{case '0':
				win++;
				break;
			case '1':
				moo++;
				break;
			case '2':
				lose++;
				break;}
			break;
		case '2':
			switch(str)
			{case '0':
				lose++;
				break;
			case '1':
				win++;
				break;
			case '2':
				moo++;
				break;}
			break;
			default:
				continue;
		}		
	}
		cout << "   " << win <<"," <<endl
			 <<" "<< lose <<","<< endl
			 <<" "<< moo <<"."<<endl;
		cout << "\n\n"<<"   " << lose <<"," <<endl
			 <<" "<< win <<","<< endl
			 <<" "<< moo <<"."<<endl;

	fin.close();
	return 0;
}
파 ... -_- ..     ~ 
  • ?--; ?
  • .....ㅡㅡ;


Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2021-02-07 05:28:38
Processing time 0.0103 sec