that_one_nigga_you_k

ep2 renovado

Jun 15th, 2021
529
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main(){
  6.    
  7.     int a, c, n, m, r, r0;
  8.    
  9.     int tam;
  10.  
  11.     cout<<"digite o parametro 'a': ";
  12.     cin>> a;
  13.     cout<<"digite o parametro 'c': ";
  14.     cin>> c;
  15.     cout<<"digite o parametro 'm': ";
  16.     cin>> m;
  17.     cout<<"digite o numero inicial: ";
  18.     cin>> r0;
  19.  
  20.    /* a=5;
  21.     c=3;
  22.     m=8;
  23.     n=8;
  24.     r0=7;
  25. */
  26.     for(int i = 0; i<12; i++){
  27.         r = ((a*r) +c)%(m+2);
  28.  
  29.         cout<<r<<" ";
  30.     }
  31.  
  32.     //cout<<r;
  33.  
  34.     return 0;
  35. }
RAW Paste Data