Skip to content

Instantly share code, notes, and snippets.

@TheoKlein
TheoKlein / a001_C.c
Last active February 14, 2016 10:04
ZeroJudge _a001_C
#include <stdio.h>
int main (){
char s[9999];
while(gets(s))
printf("hello, %s\n",s);
return 0;
}
@TheoKlein
TheoKlein / a001_C++.cpp
Last active June 6, 2016 16:16
ZeroJudge_a001_C++
#include <iostream>
#include <string>
using namespace std;
int main (){
string input;
while(cin >> input)
cout << "hello, " << input << endl;
return 0;
}
@TheoKlein
TheoKlein / a002_C.cpp
Last active February 14, 2016 10:02
ZeroJudge_a002_C
#include <stdio.h>
int main(){
int a, b;
while(scanf("%d%d",&a,&b)!= EOF)
printf("%d\n",a+b);
return 0;
}
@TheoKlein
TheoKlein / a003_C.cpp
Last active February 14, 2016 10:02
ZeroJudge_a003_C
#include <stdio.h>
int main(){
int M,D,S;
while(scanf("%d%d",&M,&D)!= EOF){
S = (M*2 + D) % 3;
if(S == 0)
printf("普通\n");
else if (S == 1)
printf("吉\n");
@TheoKlein
TheoKlein / a004_C.cpp
Last active February 14, 2016 10:03
ZeroJudge_a004_C
#include <stdio.h>
int main(){
int year;
while(scanf("%d",&year)!= EOF){
if((year % 4 == 0) && (year % 100 != 0))
printf("閏年\n");
else if(year % 400 == 0)
printf("閏年\n");
@TheoKlein
TheoKlein / a005_C.cpp
Last active February 27, 2016 03:27
ZeroJudge_a005_C
#include <stdio.h>
int main (){
int a,b,c,d,e,n,i;
while(scanf("%d",&n)!= EOF){
for ( i = 0 ; i < n ; i ++){
scanf("%d%d%d%d",&a,&b,&c,&d);
if (c - b == b - a)
printf("%d %d %d %d %d\n",a,b,c,d,d*2 - c);
@TheoKlein
TheoKlein / a006_C.cpp
Last active February 27, 2016 03:30
ZeroJudge_a006_C
#include <stdio.h>
#include <math.h>
int main (){
int a,b,c;
int x = 0, y = 0;
while(scanf("%d%d%d",&a,&b,&c)!= EOF){
if (b*b-(4*a*c) > 0){
x = ((-b) + sqrt(b*b-(4*a*c)))/(2*a);
y = ((-b) - sqrt(b*b-(4*a*c)))/(2*a);
@TheoKlein
TheoKlein / a009_C.cpp
Last active February 27, 2016 03:32
ZeroJudge_a009_C
#include <stdio.h>
#include <string.h>
//input - 7 = output
int main (){
char str[100000];
while(gets(str)!=NULL){
int i, leng;
leng = strlen(str);
for( i = 0 ; i < leng ; i ++)
@TheoKlein
TheoKlein / a010_C.cpp
Last active February 27, 2016 03:33
ZeroJudge_a010_C
#include <stdio.h>
int main (){
int in;
while(scanf("%d",&in)!=EOF){
int i;
int count = 0;
for ( i = 2 ; i * i <=in ; i ++){
while(in % i == 0){
count++;
@TheoKlein
TheoKlein / a015_C.cpp
Last active February 27, 2016 08:20
ZeroJudge_a015_C
#include <stdio.h>
int main (){
int row;
int column;
int array[100][100];
while(scanf("%d%d",&row,&column)!=EOF){
int x,k,y,t;
for(x = 0 ; x < row ; x++){