Olympiad گفت
rezashiri گفت
Olympiad گفت
خانه ي مقصد(#) ممكنه هر جايي باشه؟؟؟؟يا فقط گوشه سمت راست و پايين!؟؟!اگه راهي نبود چي؟!! نقطه ي شروع كجا هست!!!!!!!!!!!!!!!!!!؟؟؟؟؟
#include <stdio.h>
#include <conio.h>
#include <math.h>
using namespace std;
int main()
{
int k=0,u=0,n,t;
scanf("%d",&n);
int a[n][n];
for(int i=0;i<n;i++)
for(int j=0;j<n;j++)
scanf("%d",&a[I][j]);
for(t=1;t<=2*(n-1);t++);
{
if(a[k+1][U]==0)
{
printf("\tDown");
k++;
}
else
{
printf("\tRight");
u++;
}
}
printf("\tResidim!!!");
getch();
return 0;
}
#include <stdio.h>
#include <conio.h>
#include <math.h>
using namespace std;
int main()
{
int k=0,u=0,n,t;
scanf("%d",&n);
int a[n][n];
for(int i=0;i<n;i++)
for(int j=0;j<n;j++)
scanf("%d",&a[I][j]);
for(t=1;t<=2*(n-1);t++);
{
if(a[k+1][U]==0)
{
printf("\tDown");
k++;
}
else
{
printf("\tRight");
u++;
}
}
printf("\tResidim!!!");
getch();
return 0;
}
#include <stdio.h>
#include <conio.h>
#include <math.h>
using namespace std;
int main()
{
int k=0,u=0,n,t;
scanf("%d",&n);
int a[n][n];
for(int i=0;i<n;i++)
for(int j=0;j<n;j++)
scanf("%d",&a[i][j]);
start:
if(a[k+1][u]==0)
{
printf("\tDown");
k++;
if(k<n) goto start;
}
else
{
printf("\tRight");
u++;
if(u<n-1) goto start;
}
printf("\tResidim!!!");
getch();
return 0;
}
#include <stdio.h>
#include <conio.h>
int main()
{
int a,b,c,adad[100][100],rahi[100],rahj[100],k=0;
scanf("%d",&a);
for(int i=0;i<a;i++)
{
for(int j=0;j<a;j++)
{
scanf("%d",&adad[i][j]);
}
}
for(int i=0;i<a;i++)
{
for(int j=0;j<a;j++)
{
if(adad[i][j]==0){
rahi[k]=i+1;
rahj[k]=j+1;
k++; }
}
}
for(int i=0;i<k;i++)
{
if(rahj[i]+1==rahj[i+1]) printf("R-");
if(rahi[i]+1==rahi[i+1]) printf("D-");
if(i==k-1) printf("residim.");
}
getch();
return 0;
}
#include <iostream>
#include <complex>
#include <iomanip>
using namespace std;
typedef complex<double> point;
int main() {
point a, b;
cin >> a.real() >> a.imag() >> b.real() >> b.imag();
a /= b;
cout << fixed << setprecision(5) << abs(arg(a) * 360 / (2 * M_PI)) << endl;
return 0;
}
#include <iostream>
#include <complex>
#include <iomanip>
using namespace std;
typedef complex<double> point;
int main() {
point a, b;
cin >> a.real() >> a.imag() >> b.real() >> b.imag();
a /= b;
cout << fixed << setprecision(5) << abs(arg(a) * 360 / (2 * M_PI)) << endl;
return 0;
}
#include <iostream>
#include <complex>
#include <iomanip>
using namespace std;
typedef complex<double> point;
int main() {
point a, b;
cin >> a.real() >> a.imag() >> b.real() >> b.imag();
a /= b;
cout << fixed << setprecision(5) << abs(arg(a) * 360 / (2 * M_PI)) << endl;
return 0;
}
#include <stdio.h>
#include <conio.h>
#include <cmath>
int main()
{
float ai,aj,bi,bj,ci,cj,tanb1,tanb2,zavieb1R,zavieb2R,zavieb1D,zavieb2D,zavieB;
printf("please input x y for A(x,y):\t");
scanf("%f%f",&ai,&aj);
printf("please input x y for C(x,y):\t");
scanf("%f%f",&ci,&cj);
//-----------------------------------------
tanb1=cj/ci;
zavieb1R=atan(tanb1);
zavieb1D=(zavieb1R*180)/3.14159256;
//----------------------------------------
tanb2=ai/aj;
zavieb2R=atan(tanb2);
zavieb2D=(zavieb2R*180)/3.14159256;
//----------------------------------------
zavieB=zavieb1D+zavieb2D;
printf("%f",90-zavieB);
getch();
return 0;
}
#include <stdio.h>
#include <conio.h>
#include <cmath>
int main()
{
float ai,aj,bi,bj,ci,cj,tanb1,tanb2,zavieb1R,zavieb2R,zavieb1D,zavieb2D,zavieB;
printf("please input x y for A(x,y):\t");
scanf("%f%f",&ai,&aj);
printf("please input x y for C(x,y):\t");
scanf("%f%f",&ci,&cj);
//-----------------------------------------
tanb1=cj/ci;
zavieb1R=atan(tanb1);
zavieb1D=(zavieb1R*180)/3.14159256;
//----------------------------------------
tanb2=ai/aj;
zavieb2R=atan(tanb2);
zavieb2D=(zavieb2R*180)/3.14159256;
//----------------------------------------
zavieB=zavieb1D+zavieb2D;
printf("%f",90-zavieB);
getch();
return 0;
}
#include <iostream>
#include <cmath>
#include <iomanip>
using namespace std;
int main() {
cout << fixed << setprecision(15) << M_PI << endl;
return 0;
}
#include <iostream>
#include <conio.h>
using namespace std;
int main()
{
double a,b,c,a1,b1,c1;
cout<<"Zarayeb moadele #1 ra vared konid :\n";
cin>>a>>b>>c;
cout<<"Zarayeb moadele #2 ra vared konid :\n";
cin>>a1>>b1>>c1;
double a2,b2,c2,a3,b3,c3;
a2=a1*a;
b2=a1*b;
c2=a1*c;
a3=a*a1;
b3=a*b1;
c3=a*c1;
double x,y;
y=(-(c2-c3))/(b2-b3);
x=(-c2-(b2*y))/a2;
cout<<"Number X ="<<x<<"\tNumber Y = "<<y;
getch();
return 0;
}