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
N = int(raw_input()) | |
with open('outfile.txt', 'w') as outfile: | |
for test in range(N): | |
words = raw_input().strip().split(" ") | |
outfile.write("Case #{}: ".format(test + 1) + " ".join(words[::-1]) + "\n") |
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
def solution(h, m): | |
""" Return the degree bewteen hour hand and minute hand | |
""" | |
min_deg = float(m) / 60 * 360 | |
hour_deg = float(h) / 12 * 360 + float(m) / 60 * 360 / 12 | |
return min(abs(min_deg - hour_deg), 360 - abs(min_deg - hour_deg)) |
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
# If you have access to a function that returns a random integer from one to five, | |
# write another function which returns a random integer from one to seven. | |
import random | |
class Solution(): | |
def rand5(self): | |
return random.randint(1, 5) |
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
# -*- coding: utf-8 -*- | |
""" | |
Created on Wed Aug 28 10:28:18 2013 | |
@author: King | |
""" | |
import httplib | |
import urllib2 |
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
data; | |
set Crops := wheat corn beets; | |
param TotalArea:=500; | |
param BeetsQuota:=6000; | |
param Yield := | |
wheat 2.5 | |
corn 3.0 | |
beets 20.0; | |
param MinRequirement := | |
wheat 200 |
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 a = 5, b = 7; | |
a = a ^ b; | |
b = a ^ b; | |
a = a ^ b; | |
printf("a=%d b=%d", a, b); | |
return 0; |
NewerOlder