birinchisi biz uchta kutubhona chakiramiz ikinchisi esa ikta verible yaratamiz va unga nom beramiz
va ularga kiymat beramiz bu son kelgin esa ularni hohishingizga karab yoki koshasiz yoki ayirasiz
yana oz hohishizga qarab ularga boshqa son ham berisingiz mumkin pasta korib turibsiz va ohiriga cout kilamiz
#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;
int main(){
int a = 5, b= 7;
kelgisi
bu cod 5 honali sonni yaxlitlab beradi masalan input; 13900,
yozilsa 14000 chiqazadi.
int main (){
int son ;
cin >> son;
float newSon = son;
cout << round(newSon / 1000) * 1000;
return 0;
}
bu cod birorta sonni necha soat , necha minut , necha secund ekanligini chiqazib beradi.
int main (){
int secund;
cin >> secund;
cout << setw(2) << setfill ('0') << secund / 3600 << ":";
cout << setw(2) << setfill ('0') << secund % 3600 / 60 << ":";
cout << setw(2) << setfill ('0') << secund % 60 << ":";
return 0;
}
va shu bilan men sizlar bilan hayirlashaman
Top comments (0)