Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions 12 May/Q1/divisor_game.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#include<bits/stdc++.h>
using namespace std;
int lcm(int a,int b)
{
int large = max(a,b);
int small = min(a,b);
int i;
for(i=large;;i += large)
{
if (i % small ==0)
return i;
}
}

int main(){
int A=12,B=3,C=2;
int spec_int;
spec_int = A/lcm(B,C);
cout<<"the special integers "<<spec_int;



}
Binary file added 12 May/Q1/output_divisor_game.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions 12 May/Q2/enumerating_gcd.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#include<bits/stdc++.h>
using namespace std;
gcd(int a,int b)
{
if (a == b)
return a;
else
return 1;
}

int main(){

int A = 12, B= 60;
cout<<"the gcd is "<<gcd(A,B);
}
Binary file added 12 May/Q2/output_gcd.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions 13 May/Q1/divisor_game.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#include<bits/stdc++.h>
using namespace std;
int lcm(int a,int b)
{
int large = max(a,b);
int small = min(a,b);
int i;
for(i=large;;i += large)
{
if (i % small ==0)
return i;
}
}

int main(){
int A=12,B=3,C=2;
int spec_int;
spec_int = A/lcm(B,C);
cout<<"the special integers "<<spec_int;



}
Binary file added 13 May/Q1/output_divisor_game.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions 13 May/Q2/enumerating_gcd.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#include<bits/stdc++.h>
using namespace std;
gcd(int a,int b)
{
if (a == b)
return a;
else
return 1;
}

int main(){

int A = 12, B= 60;
cout<<"the gcd is "<<gcd(A,B);
}
Binary file added 13 May/Q2/output_gcd.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.