Created
December 29, 2012 15:30
-
-
Save rigibun/4407574 to your computer and use it in GitHub Desktop.
This file contains 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
//AOJ 10000 | |
import std.stdio; | |
void main() | |
{ | |
writeln("Hello World"); | |
} | |
//AOJ 10001 | |
import std.stdio; | |
import std.string; | |
import std.conv; | |
void main(){ | |
int x = readln().chomp().to!int(); | |
writeln(x * x * x); | |
} | |
//AOJ 10002 | |
import std.stdio; | |
import std.string; | |
import std.conv; | |
void main(){ | |
string[] input = split(readln()); | |
int x = to!int(input[0]); | |
int y = to!int(input[1]); | |
writeln(x * y, ' ', 2 * (x + y)); | |
} | |
//AOJ 10003 | |
import std.stdio; | |
import std.string; | |
import std.conv; | |
void main(){ | |
string str; | |
string[] input = split(readln()); | |
int a = to!int(input[0]), b = to!int(input[1]); | |
if(a > b) | |
str = " > "; | |
else if(a < b) | |
str = " < "; | |
else | |
str = " == "; | |
writeln('a',str,'b'); | |
} | |
//AOJ 10004 | |
import std.stdio; | |
import std.string; | |
import std.conv; | |
import std.algorithm; | |
void main(){ | |
string[] input = split( readln() ); | |
int[] a = new int[3]; | |
for(int i = 0; i < 3; i++){ | |
a[i] = to!int(input[i]); | |
} | |
sort(a); | |
writeln(a[0], ' ', a[1], ' ', a[2]); | |
} | |
//AOJ 10005 | |
import std.stdio; | |
void main(){ | |
for(int i = 0; i < 1000; i++) | |
writeln("Hello World"); | |
} | |
//AOJ 10006 | |
import std.stdio; | |
import std.string; | |
import std.conv; | |
void main(){ | |
int i = 1; | |
while(1){ | |
int a = readln().chomp().to!int(); | |
if(a == 0) | |
break; | |
writeln("Case ", i, ": ", a); | |
i++; | |
} | |
} | |
//AOJ 10007 | |
import std.stdio; | |
import std.string; | |
import std.conv; | |
void main(){ | |
while(true){ | |
string[] input = split( readln() ); | |
int[] a = new int[2]; | |
a[0] = to!int(input[0]); | |
a[1] = to!int(input[1]); | |
if(a[0] + a[1] == 0) | |
break; | |
sort(a); | |
writeln(a[0],' ', a[1]); | |
} | |
} | |
//AOJ 10008 | |
import std.stdio; | |
import std.string; | |
import std.conv; | |
void main(){ | |
double a, b; | |
string[] input = split( readln() ); | |
a = to!int(input[0]); | |
b = to!int(input[1]); | |
writefln("%d %d %.5f",to!int(a / b), to!int(a % b), a/b); | |
} | |
//AOJ 10009 | |
import std.stdio; | |
import std.string; | |
import std.conv; | |
void main(){ | |
double r = readln().chomp().to!double(); | |
double pi = 3.141592653589; | |
writefln("%.6f %.6f", r * r * pi, 2 * r * pi); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment