source e eslah shodeye masaleye Beyzi (by amir hajiali khamse)

2 views
Skip to first unread message

Arian Bn

unread,
Dec 4, 2010, 9:27:40 AM12/4/10
to مبانی کامپیوتر و برنامه سازی سال 89 نرم افزار
#include <iostream>
#include <iomanip>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
using namespace std;

int main()
{
int p;//place
int a,b,n,t;
// cin>>a>>b;
while(cin>>a)
{
cin>>b;
int a2=a/2,b2=b/2,ab2=((a*a)*(b*b))/16;
for(int i=0;i<=a;i++)
{
for(int j=0;j<=b;j++)
{
if(b2*b2*(i-a2)*(i-a2)+a2*a2*(j-b2)*(j-b2)<=ab2)
cout<<'*';
else
cout<<' ';
}
cout<<'\n';
}
cout<<'\n';
}
return 0;
}
Reply all
Reply to author
Forward
0 new messages