Public: string bosh punkt
Download 189.47 Kb.
|
dasturlash10
6) #include #include using namespace std; class marshrut { public: string bosh_punkt; string oxir_punkt; int nomeri; void show(void) { cout<<"marshrut boshi punktining nomi: "< } }; int main() { marshrut a[100]; int n; cout<<"MArshrutlar sonini kiriting : "; cin>>n; for (int i=0; i cin>>a[i].bosh_punkt; cout<<"\nmarshrut oxiri punktining nomi: "; cin>>a[i].oxir_punkt; cout<<"\nmarshrut nomeri: "; cin>>a[i].nomeri; } cout<<"\na) massiv marshrut nomerlarining o'sishi bo'yicha tartiblansin\n"; for (int i=0; i if(a[i].nomeri>a[j].nomeri) swap(a[i],a[j]); } } for (int i=0; i cout< cout<<"qidirilayotgan marshrut nomeri: "; int b; cin>>b; cout< a[i].show(); } else cout<<"bunday marshrut yoq!!!"; break; } cout<<"\n\n d) boshlanashi yoki oxiri shu punkt bo'lgan marshrutlar haqidagi ma'lumotlar chop etilsin.: \n"; cout<<"qidirilayotgan marshrut bosh punkti nomi: "; string d,c; cin>>d; cout<<"qidirilayotgan marshrut oxirgi punkt nomi: "; cin>>c; for (int i=0; i a[i].show(); } else cout<<"bunday marshurt mavjud emas!!"; break; } } 13)
#include using namespace std; int removeDupWord(string str,string s[]) { int a=0; istringstream ss(str); do { string word; ss >> word; s[a++]=word; } while (ss); return a; } int main() { cout<<"Satar kiriting: \n"; string A; getline(cin,A); ; string a[1000]; int a_size=removeDupWord(A,a); cout<<"\n\nBoshi va oxirgi harflari bir xil bolgan so'zlar: \n"; for(int i=0;i if(s[0]==s[s.length()-1]) cout< } return 0; } b) #include using namespace std; int removeDupWord(string str,string s[]) { int a=0; istringstream ss(str); do { string word; ss >> word; s[a++]=word; } while (ss); return a; } int main() { cout<<"Satar kiriting: \n"; string A; getline(cin,A); ; string a[1000]; int a_size=removeDupWord(A,a); cout<<"\n\ntoq uzunlikdagi so'zlarning o'rtadagi harfini uchirish: \n"; for(int i=0;i if(a[i].length()%2!=0){ string s=""; int k=((a[i].length())/2); for(int j=0; j if(k!=j) s+=a[i][j]; a[i]=s; } } for (int i=0; i cout< } return 0; } 15)
using namespace std; struct Guruh { char name[100]; char tug_yil[100]; }; int main () { int n; cout<<"Talabalar sonini: "; cin>>n; Guruh t[100]; cout< cout<<"\n"< cin>>t[i].tug_yil; cout<<"_________________________________________________________________________"; } cout<<"\nTalabalarning ism familiyalari bo'yicha tartiblash:\n"; for (int i=0; i if(int(x[0])>int(y[0])) swap(t[i],t[j]); else if(int(x[0])==int(y[0])&&t[i].tug_yil } } for(int i=0; i return 0; } Download 189.47 Kb. Do'stlaringiz bilan baham: |
Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling
ma'muriyatiga murojaat qiling