|
include
|
Дата | 15.11.2019 | өлшемі | 12,6 Kb. | | #51881 |
| Байланысты: include 14.11.19, 14.11.19, 14.11.19, include#include
#include // для system
using namespace std;
int main()
{
int n, m;
int r=0;
int s=0;
int a[100], b[100];
float x[100], d;
int i, j;
cout<<"n=";
cin>>n;
cout<<"m=";
cin>>m;
for (i=1; i<=n; i++){
cout<<"a["<
cin>>a[i];
b[i]=m/a[i];
}
x[1]=b[1];
d=(m-s)/a[1];
s=s+x[1]*a[1];
r=r+1;
for(i=n; i>=1; i--){
j=1;
if (x[j]
x[j]=x[j]+1;
s=s+a[j];
}
for(int k=1; k
b[k]=(m-s)/a[k];
}
x[j]=0;
s=s-a[j]*b[j];
while(j<=n){
j++;
}
cout<
}
cout << "Hello, world!" << endl;
system("pause"); // Только для тех, у кого MS Visual Studio
return 0;
}
3-programma
#include
#include // для system
#include
using namespace std;
int main()
{
int a, b, c;
cout<<"a=";
cin>>a;
cout<<"b=";
cin>>b;
cout<<"c=";
cin>>c;
int k=0;
int x, y;
for (x=-(sqrt(c/a)); x<=sqrt(c/a); x++){
for (y=-(sqrt(c/b)); y<=sqrt(c/b); y++){
if (a*x*x+b*y*y==c) {
cout<<"{x="<
k++;
}
}
}
if (k==0) {cout<<"sheshimi joq";}
system("pause"); // Только для тех, у кого MS Visual Studio
return 0;
}
Достарыңызбен бөлісу: |
|
|