Advertisement
Dizzy3113

Untitled

Nov 17th, 2019
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. using namespace std;
  4.  
  5. int cmmdc(int a, int b)
  6. {
  7. while(a!=b)
  8. {
  9. if(a>b)
  10. a=a-b;
  11. else
  12. b=b-a;
  13. }
  14. return a;
  15. }
  16. int main()
  17. {
  18. int n, x,v[100], poz=0;
  19. ifstream f("NUMERE.IN");
  20. f>>n;
  21. while(f>>x)
  22. {
  23. v[poz]=x;
  24. poz++;
  25. }
  26. for(int i=0; i<n; i++)
  27. {
  28. cmmdc()??;
  29. }
  30.  
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement