[ create a new paste ] login | about

Link: http://codepad.org/EMh63CT0    [ raw code | output | fork ]

yifan666 - C, pasted on Aug 10:
//maze

#include <stdio.h>
#include <string>

int Qx[1000];
int Qy[1000];
int f, r;

void Init(){
	f = -1;
	r = -1;
}

void push(int x, int y){
	f++;
	Qx[f] = x;
	Qy[f] = y;
	printf("%d %d", Qx[f], Qy[f]);
}

void pop(int &x, int &y){
	r++;
	x = Qx[r];
	y = Qy[r];
}

int main()
{
	int N;
	freopen("maze.txt","r", stdin);
	char a[17][17];
	int test_case;

	for(test_case=0; test_case<1; test_case++){
		int i = 0; int j= 0;
		scanf("%d", &N);
		
		for(int i =0; i<17; i++){
		//	printf("");
//			String s = "";
			
			gets(a[i]);
			
			for(int j =0; j<17; j++){
				printf("%c ", a[i][j]);
			}	
			printf("\n");

		}	
			
//		printf("#%d min= %d, x= %d\n", test_case+1, min, c);			
	}
	return 0;
}


Output:
1
2
3
4
5
6
7
Line 17: error: string: No such file or directory
Line 22: error: expected ';', ',' or ')' before '&' token
In function 'main':
Line 39: error: redefinition of 'i'
Line 36: error: previous definition of 'i' was here
Line 39: error: 'for' loop initial declaration used outside C99 mode
Line 45: error: 'for' loop initial declaration used outside C99 mode


Create a new paste based on this one


Comments: