kellex

iteration_graph

Jan 7th, 2014
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.20 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <iostream>
  4. #include <math.h>
  5.  
  6. using namespace std;
  7.  
  8. //int x,y;
  9. //x=24;
  10. //y=80;
  11. int z,zi,c;
  12. char SK[18][40] = {"                             ",
  13.            "                             ",
  14.            "                             ",
  15.            "                             ",
  16.            "                             ",
  17.            "                             ",
  18.            "                             ",
  19.            "                             ",
  20.            "                             ",
  21.            "                             ",
  22.            "                             ",
  23.            "                             ",
  24.            "                             ",
  25.            "                             ",
  26.            "                             ",
  27.            "                             ",
  28.            "                             ",
  29.            "                             "};
  30.  
  31. main(){
  32.     printf("Enter a value for Z: ");
  33.     cin >> z;
  34.     printf("\n");
  35.     printf("Enter a value for C: ");
  36.     cin >> c;
  37.     printf("\n");
  38.  
  39.     for(int i=0;i<10;i++){
  40.         zi=(z*z)+c;
  41.         cout << "y: " << zi << " | x: " << z << "\n";
  42.  
  43.         for(int y=0;y<18;y++){
  44.             for(int x=0;x<40;x++){
  45.                     SK[zi][z] = '*';
  46.             }
  47.         }
  48.  
  49.         z=zi;
  50.     }
  51.  
  52.     cout << SK[18][40];
  53. }
Advertisement
Add Comment
Please, Sign In to add comment