Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<fstream>
- using namespace std;
- struct fractii
- {
- int n,N;
- }v[51];
- void citire()
- {
- int nr_fractii, i;
- ifstream.fin("fractii.in");
- fin>>nr.fractii;
- for(i=1;i<nr_fractii;i++)
- fin>>v[i].n>>v[i].N;
- }
- int cmmdc(int a, int b)
- {
- int r;
- while(b<a)
- {
- r=a%b;
- a=b;
- b=r;
- }
- return r;
- }
- int cmmmc(int a, int b)
- {
- int cmmdc, cmmme;
- cmmdc=cmmdc(a,b);
- cmmme=a*b/cmmdc;
- return cmmmc;
- }
- void afisare_ired()
- {
- int i,x;
- for(i=1;i<=nr_fractii;i++)
- {
- i=cmmde(v[i].n, v[i].N);
- cout<<v[i].n/x<<" "<<v[i].N/x<<"\n";
- }
- }
- int suma()
- {
- int i, cmmmc, cmmdc;
- for(i=1;i<nr_fractii;i++)
- cmmmc=cmmmc(v[i].n,v[i].N)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement