Toggle menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

정모/2013.5.6/CodeRace

From ZeroWiki
Revision as of 10:43, 6 May 2013 by imported>jereneal20

CodeRace 2013

김현빈, 김태진

#include <stdio.h>

int main(int argc, const char * argv[])
{
	int aa=0,ab=0,ac=0,i=0;
	char a[4],b[4],c[4],r[4];
	
	FILE* fp;
	fp=fopen(argv[1],"r");
	for(i=0;i<4;i++){
	fscanf(fp,"%s",r);
	if(r[0]=='a'){
		aa++;
		a[0]=r[0];
		a[1]=r[1];
		a[2]=r[2];
	}else if(r[0]=='b'){
		ab++;
		b[0]=r[0];
		b[1]=r[1];
		b[2]=r[2];
	}else if(r[0]=='c'){
		ac++;
		c[0]=r[0];
		c[1]=r[1];
		c[2]=r[2];
	}
	}
	printf("%s %d\n",a,aa);
	printf("%s %d\n",b,ab);
	printf("%s %d",c,ac);
	
	
	return 0;
}

팀2

팀3

팀4

팀5

팀6

팀7

팀8