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.0071 sec