This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
typedef struct _btree { | |
int n; | |
struct _btree *left; | |
struct _btree *right; | |
}BTree; | |
BTree * createNode() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main() { | |
int input; | |
while(!feof(stdin)) { | |
scanf("%d",&input); | |
printf("%d\n",input); | |
} | |
return 0; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <string.h> | |
#define MAX 80 | |
char code1[MAX+1]; | |
int pos1[MAX+1]; | |
int code1_i, pos1_i ,len1; | |
char code2[MAX+1]; | |
int pos2[MAX+1]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int base[16]; | |
int palindrom(int len) { | |
int i,j; | |
for(i = 0,j = len-1; i < j; ++i, --j) { | |
if (base[i] != base[j]) | |
return 0; | |
} | |
return 1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int stack[50]; | |
int width, i, height, sum, total_move, count = 1; | |
int main() { | |
scanf("%d",&width); | |
while (width != 0) { | |
for (i = sum = 0; i < width; sum += stack[i++]) | |
scanf("%d",&stack[i]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <math.h> | |
int a, b, c, count = 1; | |
double result; | |
int main() { | |
scanf("%d %d %d", &a, &b, &c); | |
while (a != 0 && b != 0 && c != 0) { | |
if (c == -1) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <string.h> | |
char digit[61]; | |
char result[61]; | |
int multiply_by(int n, int len) { | |
int i, carry = 0, v; | |
for (i = len-1; i >= 0; --i) { | |
v = (digit[i]-'0')*n + carry; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <string.h> | |
#define min(A,B) (A < B)?A:B | |
#define max(A,B) (A > B)?A:B | |
int main() { | |
int test, n, v, best; | |
char type[9]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
char tile[20][21]; | |
int count_black(int i, int j, int w, int h) { | |
int count = 0; | |
if (tile[i][j] == '.' || tile[i][j] == '@') { | |
count++; | |
tile[i][j] = '#'; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <string.h> | |
char square[4][5]; | |
char temp[4][5]; | |
typedef struct _point { | |
int i; | |
int j; | |
}Point; |