Berilgan nomdagi matnli faylni yaratish va unga belgilar to’plamidan iborat satr kiritish dasturini tuzing. Faqat lotin harflar miqdorini aniqlang. Va lotin harflarni ekranga chiqaring


Download 198.4 Kb.
Sana30.12.2022
Hajmi198.4 Kb.
#1072705
Bog'liq
Abdulaziz6



MUHAMMAD AL-XORAZMIY NOMIDAGI TOSHKENT AXBOROT TEXNOLOGIYALARI UNIVERSITETI
TELEKOMMUNIKATSIYALAR FAKULTETI


Dasturlash I fani
6-amaliy topshiriq

Bajardi: 413-22-guruh 1-bosqich talabasi


Sunnatullayev Abdulaziz
Tekshirdi: Ishniyazov Odil


TOSHKENT 2022
Variant -18

1-savol. Berilgan nomdagi matnli faylni yaratish va unga belgilar to’plamidan iborat satr kiritish dasturini tuzing. Faqat lotin harflar miqdorini aniqlang. Va lotin harflarni ekranga chiqaring.
Kodi:
#include
#include
using namespace std;
int main(){
ifstream in("input(3).txt");
ofstream out("output.txt");
string satr = "bhd12sd';,sgas.*/-dfsv+bc";
int c=0; string satr2 = "";
in >> satr;
for(int i=0; iif((int)satr.at(i)>=65 && (int)satr.at(i)<=90 || (int)satr.at(i)>=97 && (int)satr.at(i)<=122){
c++;
satr2+=satr.at(i);
}
}
out<out<cout<<"Bajarildi."<cout<in.close();
out.close();
}
Natijasi:



2-savol. input.txt faylida natural n soni berilgan. Berilgan n sonining raqamlarini teskari tartibda yozishdan hosil bo’lgan sonni output fayliga yozish dasturini tuzing.
Kodi:
#include
#include
using namespace std;
int main(){
ifstream in("input.txt");
ofstream out("output.txt");
int n,b=0;
in >> n;
while(n>0){
b = b*10+n%10;
n=n/10;
}
out << b;
cout<<"Bajarildi.";
in.close();
out.close();
}
Natijasi:

Download 198.4 Kb.

Do'stlaringiz bilan baham:




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