Guest User

Untitled

a guest
Oct 18th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.84 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     /*int x;
  8.     cout<<"adj egy szamot megmondom prim-e? ";
  9.     cin>>x;
  10.     int i=2;
  11.  
  12.     while( x%i!=0 ){
  13.         i++;
  14.     }
  15.     if( i<x) cout<<"nem prim";
  16.     else cout<<"prim";
  17. */
  18.  
  19.     int x;
  20.     cout<<"adj egy szamot megmondom prim-e? ";
  21.     cin>>x;
  22.     cin>>y;
  23.     int lnko=1;
  24.     int i=2;
  25.     //int db=0;
  26.     while( i<=x && i<=y){
  27.         if(x%i==0 && y%i==0) lnko=i;    //cout<<i<<" ";
  28.         i++;
  29.     }
  30.    
  31.    
  32.     if(  ) cout<<"nem prim";
  33.     else cout<<"prim";
  34.         //x==i prim ....
  35.  
  36.  
  37.  
  38.     /*int x;
  39.     cout<<"Gondoltam egy egesz szamra 1-100 kozott";
  40.     do{
  41.       cin>>x;
  42.       if(x>i) cout<<"A gondolt szam kisebb "<<endl;
  43.       if(x<i) cout<<"A gondolt szam nagyobb "<<endl;
  44.  
  45.     }while(x!=i);
  46.  
  47.     cout<<"siker";
  48. */
  49.     return 0;
  50. }
Advertisement
Add Comment
Please, Sign In to add comment