Search found 2 matches

by JCU
Wed Dec 05, 2007 4:04 pm
Forum: Volume 2 (200-299)
Topic: 275 - Expanding Fractions
Replies: 47
Views: 26897


#include<iostream>
using namespace std;

int main()
{
long long a,b;
long long q;
int m[100000] = {0};
int n[100000] = {0};
int i;
int jump;
int counter = 1;
while(cin >> a >> b)
{
if(a == 0 && b == 0)
break;

if(a%b == 0)
{
cout << ".";
cout << "\nThis expansion terminates.\n ...
by JCU
Mon Nov 26, 2007 4:41 pm
Forum: Volume 9 (900-999)
Topic: 942 - Cyclic Numbers
Replies: 3
Views: 4195

942 - Cyclic Numbers

#include<iostream>
#include<cstring>
#include<cstdlib>
#include<cmath>
using namespace std;

void ntoi(char str[],int n)
{
char temp[100000] = {0};
int i = 0;
if(n == 0)
{
str[0] = '0';
str[1] = 0;
return;
}
while(n != 0)
{
temp = (n%10)+48;
i++;
n/=10;
}
for(int j = 0;j < i;j ...

Go to advanced search