Kompyuter injinering ” fakulteti 103-guruh talabasi eshnazarov Rustam ning dasturlash fanidan mustaqil ishi №8


Download 0.97 Mb.
bet7/7
Sana11.02.2023
Hajmi0.97 Mb.
#1189947
1   2   3   4   5   6   7
Bog'liq
2 5327958925562086610

7. #include
#include
using namespace std;
int main(){
srand(time(0));
int a[100],b[100],m,t;
fstream s;
s.open("13_4.txt");
for(int i=1;i<=100;i++){
a[i]=rand();
s>>a[i];
b[i]=a[i];}
for(int i=0;i<99;i++){
m=i;
for(int j=i+1;j<99;j++)
if(b[j]
t=b[m];
b[m]=b[i];
b[i]=t;}
for(int i=0;i<100;i++){
s>>b[i];}
int k=0;
for(int i=0;i<100;i++){
k++;
cout<<" "<
if(k==10){k=0;
cout<
s.close();
cout<<"ok"<
cout<<"103-guruh talabasi "<
cout<<" Eshnazarov Rustam";
return 0;}


8.
#include
#include
using namespace std;
int main(){
ofstream s;
s.open("Satrlar.txt");
s<<"103"<
s<<"Eshnazarov"<
s<<"Rustam"<
s.close();
ifstream input("Satrlar.txt");
if(input.fail()){
cout<<"fayl yaratilmagan"<
cout<<"dasturni yopish"<
string x1,x2,x3;
input>>x1;
input>>x2;
input>>x3;
input.close();
if(x1>x2&&x1>x3&&x2>x3)
cout<<"Saralangan";
else cout<
cout<<"103-guruh talabasi "<
cout<<"Eshnazarov Rustam ";
return 0;}




9.
#include


#include
using namespace std;
int main(){
srand(time(0));
int a[100];
fstream binaryio("13_13.dat",ios::out|ios::binary);
for(int i=1;i<=100;i++){
a[i]=rand();
binaryio<binaryio.close();
cout<<"OK"<cout<<"103-guruh talabasi "<cout<<"Eshnazarov Rustam ";

return 0;}
Download 0.97 Mb.

Do'stlaringiz bilan baham:
1   2   3   4   5   6   7




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