Lutfullayev Avazbek Dasturlash 1 variant 8



Download 162,77 Kb.
Sana15.12.2022
Hajmi162,77 Kb.
#887460
Bog'liq
Dasturlash dedline 2


Lutfullayev Avazbek Dasturlash 1 variant 8



Guruxdagi o’quvchilarning familiyasi, ismi, tug’ilgan yili va oyi, sanasi xaqida ma’lumot berilgan. Bahorda tug’ilgan o’quvchilar ro’yxatini chop etuvchi dastur tuzing.

#include


#include
#include
using namespace std;
struct student {
string familya;
string ism;
int birthYear;
int birthMonth;
};

void display(struct student student_record[4])


{
int i, len = 5;

for (i = 0; i < len; i++) {


if(student_record[i].birthMonth >=3 && student_record[i].birthMonth<=5){
cout<<"Familya : \t"<cout<<" Ismi : \t"<< student_record[i].ism;
cout<<"Tug'ulgan Yili : \t"<cout<<"\n";
cout<<"Tug'ulgan oyi :\t"<}
}
}
int main()
{

struct student student_record[4]


= { { "Urolaliyev","Jamshid",2003,11 },
{ "Esanov","Jamshid",2002,5 },
{ "Niyozov","Maruf",2004,4 },
{ "Vafoyev","Gayrat",2003,3 } };

cout<<"Bahorda tug'ulgan talabalar \n";


display(student_record);
cout<<"\n";

}

2


String turidagi A satrda nechta bir xil soʻz borligini aniqlovchi dastur tuzing.

/******************************************************************************

Online C++ Compiler.
Code, Compile, Run and Debug C++ program online.
Write your code in this editor and press "Run" button to compile and execute it.

*******************************************************************************/

#include
#include

using namespace std;

int main()
{
string str;
cout<<"Mattnini kiriting \n";
getline(cin,str);
string a[100];
int n = 0,k = 0;
for(int i = 0;iif(str[i] == ' '){
string soz;
for(int j = n;jsoz = soz + str[j];
}
a[k]= soz;
k++;
n = i-1;
}
}
int count=0;
for(int i = 0,j =k;i{
if(a[i] == a[j] ){
cout<count++;
}
if(i == j){
break;
}
}
cout<<"Bir xil so'zlar soni "<}



Berilgan nomdagi matnli faylni yaratish va unga matn kiritish dasturini tuzing. Matndan eng qisqa so’zni toping.

/******************************************************************************

Online C++ Compiler.


Code, Compile, Run and Debug C++ program online.
Write your code in this editor and press "Run" button to compile and execute it.

*******************************************************************************/

#include
#include
#include

using namespace std;



int main()
{
string str,str2;
cout<<"Faylga nom kiriting \n";
getline(cin,str2);
ofstream file("text.txt");
cout<<"Mattnini kiriting \n";
getline(cin,str);
file<string a[100];
int b[100];
int n = 0,k = 0;
for(int i = 0;iif(str[i] == ' '){
string soz;
for(int j = n;jsoz = soz + str[j];
}
a[k]= soz;
k++;
n = i+1;
}
}
int count=0,min = a[0].length();
string s;
for(int i = 0;i{
cout<if(min>a[i].length()){
cout<s = a[i];
min = a[i].length();
}
}
cout<<"Eng kichik so'z "<}



Download 162,77 Kb.

Do'stlaringiz bilan baham:




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish