Skip to content

Instantly share code, notes, and snippets.

@TheoKlein
TheoKlein / a007_C.cpp
Last active February 27, 2016 03:48
ZeroJudge_a007_C
#include <stdio.h>
#include <stdlib.h>
int check(int num);
int prime[1000000] = {2,3,5,7};
int i = 4;
void buildprime();
int main() {
int input = 0;
@TheoKlein
TheoKlein / a013_C++.cpp
Last active February 27, 2016 08:14
ZeorJudge_a013_C++
#include<iostream>
using namespace std;
int roman_to_number( string s ){
int output = 0;
for( int i = 0 ; i < s.length() ; i++){
switch( s[i] ){
case 'I':
output++;
break;
@TheoKlein
TheoKlein / a053.cpp
Created September 19, 2015 11:22
ZeroJudge a053
#include <stdio.h>
int main() {
int n,score;
while (scanf ("%d",&n) != EOF){
if (n >=0 && n <= 10){
score = n * 6;
printf ("%d\n",score);
}else if (n >= 11 && n <= 20){
score = (n-10) * 2 + 60;
@TheoKlein
TheoKlein / ZeroJudge d049.cpp
Created September 19, 2015 11:26
ZeroJudge d049
#include <stdio.h>
int main(int argc, const char * argv[]) {
int n;
scanf ("%d",&n);
printf ("%d\n", (n - 1911));
return 0;
}
@TheoKlein
TheoKlein / ZeroJudge d050.cpp
Created September 19, 2015 11:27
ZeroJudge d050
#include <stdio.h>
int main(int argc, const char * argv[]) {
int t;
while (scanf ("%d",&t) != EOF){
printf ("%d\n",(t + 9) % 24);
}
return 0;
}
@TheoKlein
TheoKlein / ZeroJudge d051.cpp
Created September 19, 2015 11:31
ZeroJudge d051
#include <stdio.h>
int main(int argc, const char * argv[]) {
double n;
scanf ("%lf",&n);
printf ("%.3f\n",(n-32)*5/9);
return 0;
}
@TheoKlein
TheoKlein / ZeroJudge d058.cpp
Created September 19, 2015 11:32
ZeroJudge d058
#include <stdio.h>
int main() {
int n;
scanf ("%d",&n);
//true = 1 , false = 0
printf ("%d\n",(n > 0) - (n < 0));
return 0;
}
@TheoKlein
TheoKlein / ZeroJudge d060.cpp
Created September 19, 2015 11:34
ZeroJudge d060
#include <stdio.h>
int main() {
int m;
scanf ("%d",&m);
printf ("%d\n",(85 - m) % 60);
return 0;
}
@TheoKlein
TheoKlein / ZeroJudge d063.cpp
Created September 19, 2015 11:36
ZeroJudge d063
#include <stdio.h>
int main() {
int a;
scanf ("%d",&a);
printf ("%d\n",(a-1)*(-1));
return 0;
}
@TheoKlein
TheoKlein / ZeroJudge d064.c
Last active August 11, 2016 15:21
ZeroJudge d064
#include <stdio.h>
int main() {
int a;
scanf ("%d",&a);
if (a % 2 == 1){
printf ("Odd\n");
}else{
printf ("Even\n");
}