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
caseCount = int(input()) | |
def compute_sum(num): | |
result = 0 | |
for o in str(num): | |
o = int(o) | |
result += o | |
return str(result) |
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
caseCount = int(input()) | |
def compute_sum(num): | |
result = 0 | |
for o in str(num): | |
o = int(o) | |
result += o | |
return str(result) |
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
#include <boost/thread.hpp> | |
#include "windows.h" | |
#include <iostream> | |
void infiniteRunningLoop() { | |
while (1) { | |
; | |
} | |
} |
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
#include <boost/thread.hpp> | |
#include "windows.h" | |
#include <ctime> | |
#define INTERVAL 10 | |
void infiniteLoop() { | |
while (1) { | |
clock_t startTime = clock(); | |
while (clock() - startTime <= INTERVAL) | |
; |
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
#include <boost/thread.hpp> | |
#include "windows.h" | |
#define INTERVAL 10 | |
void infiniteLoop() { | |
while (1) { | |
DWORD startTime = GetTickCount(); | |
while (GetTickCount() - startTime <= INTERVAL) | |
; | |
boost::posix_time::millisec sleepTime(INTERVAL); |