Advertisement
Guest User

Untitled

a guest
Feb 18th, 2020
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. #include <iostream>
  2. #include <graphics.h>
  3. #include <math.h>
  4. #include <string.h>
  5. #include <stdio.h>
  6. #include <fstream>
  7.  
  8. using namespace std;
  9.  
  10. int coord_center[50][50], viz[50], a[21][21];
  11. const float Pi=3.14;
  12.  
  13. ifstream in("graf.in");
  14. //#define PI 3.14
  15.  
  16. int m[7];
  17.  
  18. void init_graf(int a[21][21])
  19. {
  20. for(int i=1;i<=21;i++)
  21. for(int j=1;j<=21;j++)
  22. a[i][j]=0;
  23. }
  24.  
  25. void citire_muchii(int a[21][21],int &n)
  26. {
  27. in>>n;
  28. int i,j;
  29. while(in>>i>>j)
  30. a[i][j]=1;
  31. }
  32.  
  33. int main()
  34. {
  35. int alfa, n, xi, yi, x=500, y=350, R=200, r=40;
  36. alfa=2*Pi/n;
  37. cout<<alfa;
  38. init_graf(a);
  39. citire_muchii(a,n);
  40. for(int i=0;i<n;i++)
  41. {
  42. if(x>=500)
  43. xi=x+R*cos(i*alfa);
  44. else
  45. xi=x+R*cos(i*alfa);
  46. if(y>)
  47. yi=y-R*sin(i*alfa);
  48. }
  49.  
  50. initwindow(1000,1000);
  51.  
  52.  
  53. getch();
  54. closegraph();
  55. return 0;
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement