|
|
bet | 6/6 | Sana | 21.06.2022 | Hajmi | 0,78 Mb. | | #686905 |
| Bog'liq Dasturlash 2. 8-hafta topshiriq javoblari
Javob:
Dastur kodi:
#include
#include
#include
#include
using namespace std;
int main()
{
ifstream input;
input.open("d:\\Mashq13_3.dat");
if(input.fail())
{
ofstream output("d:\\Mashq13_3.dat");
cout << "Fayl yaratildi\nDasturdan chiqish\n";
return 0;
}
input.close();
ofstream output("d:\\Mashq13_3.dat");
srand(time(0));
for(int i = 0; i < 100; i++)
{
output << rand() % 100 << " ";
}
output.close();
return 0;
}
Dastur ishlashidan avval:
Dastur ishlagandan so’ng:
Do'stlaringiz bilan baham: |
|
|