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 <stdio.h> | |
#include <cmath> | |
using namespace std; | |
const int limitValue = 1000000; | |
//const int num = 78498; | |
const int num = 78500; |
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 <cstdio> | |
using namespace std; | |
void hanoi(int i, char a, char b, char c) | |
{ | |
if(i == 1) | |
{ | |
printf("Move ring %d from %c to %c\n", i, a, c); | |
} |
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 <iostream> | |
#include <string> | |
// Fibonacci | |
using namespace std; | |
string addition(string s, string s2) // 加法 | |
{ | |
int len, lenS, MaxL, i, a, b, c = 0; | |
string BNstr(s2); |
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<stdio.h> | |
// val 存結果。p 紀錄階乘結果。psize 紀錄算到多少階乘。 | |
int val[1001], p[10000], psize = 0; | |
int main(){ | |
int i, j, n; | |
p[0] = 1; | |
val[0] = 1; | |
for(i = 1; i <= 1000; i++){ |
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 <iostream> | |
using namespace std; | |
int get_cycle_length(int num); | |
int main(void) | |
{ | |
int i, j, k, start, end; | |
int maximum = 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 <iostream> | |
#include <iomanip> | |
using namespace std; | |
/* | |
15 28 6 56 60000 22 496 0 | |
15 DEFICIENT |
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 <iostream> | |
using namespace std; | |
void prtTriangle(short a, int f) | |
{ | |
short start = -a + 1; | |
short end = a - 1; | |
for( int times = 0; times < f - 1; times++ ) | |
{ |
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 <iostream> | |
using namespace std; | |
int main(void) | |
{ | |
char ch; | |
int count = 1; | |
while( cin.get(ch) ) | |
{ |
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 <iostream> | |
using namespace std; | |
long f91(int n) | |
{ | |
if( n >= 101 ) | |
return n - 10; | |
else | |
return 91; |
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 <iostream> | |
using namespace std; | |
int main() | |
{ | |
long long int a, b, d; | |
while( cin >> a >> b ) | |
{ | |
d = a - b; |