Inomjonov Jakhongir 120-20 Berilgan sozgacha bolgan sozlarni o’chiradigan dastur tuzing
Download 25.14 Kb.
|
10-laboratoriya (1)
- Bu sahifa navigatsiya:
- String
Inomjonov Jakhongir 120-20 Berilgan sozgacha bolgan sozlarni o’chiradigan dastur tuzing #include #include using namespace std; int main() { cout << strstr( "Tatu 120-20 guruh talabasi","guruh" ); return 0; }
Satrdagi so’zlarni teskarisiga almashtiradigan dastur tuzing #include #include using namespace std; string reverse_char(char str[]){ string rever; int j=0; for (int i = strlen(str)-1; i>=0 ; --i) { rever+=str[i]; } return rever; } int main(){ char a[]="print hello world"; cout< return 0;
}
#include #include using namespace std; char* sarala_osish(char *a,int n){
for (int i = 0; i char t;
for (int j = i+1; j < n; ++j) { if (a[i]>a[j]){
t=a[j];
a[i]=t;
}
} }
char* sarala_kamayish(char *a,int n){ char t;
if (a[i]
t=a[j];
a[j]=a[i]; a[i]=t;
}
} return a; }
int main(){ char const *A = s.c_str(); char const *B = A; cout< B=sarala_kamayish((char *) B, s.length());
cout< |
ma'muriyatiga murojaat qiling