1-topshiriq
1-misol
#include
#include
using namespace std;
int main(){
float n,m,d,Y ;
cout<<"n="; cin>>n;
cout<<"m="; cin>>m;
cout<<"d="; cin>>d;
if(d>1){
Y=(n*(m*m)+(d*d));
}else{
Y=d/(n*n+m*m);
}
cout<<"javob="<main();
}
2-misol
K butun soni berilgan.Baho natijalarini chiqaruvchi dastur tuzing.(1-yomon,2-qoniqarsiz,3-qoniqarli,4-yaxshi,5-a’lo).Agar K soni 1-5 oraliqqa tegishli bo’lmasa “xato”degan xabar chiqarilsin.
#include
#include
using namespace std;
int main(){
int b;
cin>>b;
switch(b){
case 1: cout<<"yomon"<case 2: cout<<"qoniqarsiz"<case 3: cout<<"qoniqarli"<case 4: cout<<"yaxshi"<case 5: cout<<"a'lo"<default: cout<<" error oraliqga mos emas"<}
main();
}
Do'stlaringiz bilan baham: |