Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include<graphics.h>
- #include<math.h>
- using namespace std;
- int main()
- {
- initwindow(800,800);
- int rx=250,ry=200 ,ox=300,oy=300,n=7;
- double VhodA[7]={30,59,65,14,3,300,150},
- start=0,krai=0,gama=0;
- double sum=0;
- double oxp ,oyp,beta;
- double xt,yt;
- for(int i=0;i<n;i++)
- {
- sum+=VhodA[i];
- }
- for(int k=0;k<41;k++){
- for(int i=0;i<n;i++){
- gama=VhodA[i] /sum*360;
- krai=start+gama;
- setcolor(i+1);
- setfillstyle(1,i+9);
- beta=(start+gama/2) /180*3.14;
- oxp = ox + 0.1 * rx * cos(beta);
- oyp = oy - 0.1 * ry * sin(beta);
- sector(oxp,oyp-k,start,krai,rx,ry);
- start=krai;
- if(k==40){
- xt=oxp+1.2*rx*cos(beta);
- yt=oyp-k-1.2*ry*sin(beta);
- outtextxy(xt,yt,"asap");
- }
- }
- }
- getch();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement