Compare commits

...

2 Commits

Author SHA1 Message Date
4f1dff7e51 Wywalono artefakty do gitignora 2022-10-26 16:51:16 +02:00
196c9c3241 Pierwsze dwa zadania z 4 labu 2022-10-26 16:50:17 +02:00
3 changed files with 41 additions and 0 deletions

3
.gitignore vendored
View File

@@ -348,3 +348,6 @@ MigrationBackup/
# Ionide (cross platform F# VS Code tools) working folder
.ionide/
**a.out**

View File

@@ -0,0 +1,16 @@
#include <iostream>
int main(int argc, char *argv[])
{
srand(time(NULL));
int n;
int i = 0;
std::cin >> n;
double tabela[n];
while (i<n){
tabela[i] = rand() / 2147483647.0;
i++;
}
for (double i : tabela){
std::cout << i << std::endl;
}
}

View File

@@ -0,0 +1,22 @@
#include <iostream>
int main(int argc, char *argv[])
{
srand(time(NULL));
int n;
int i = 0;
std::cin >> n;
double tabela[n];
while (i<n){
tabela[i] = rand() / 2147483647.0;
i++;
}
double imin = 1.0;
for (double i : tabela){
if (i < imin){
imin = i;
}
std::cout << i << std::endl;
}
std::cout << "\n"<< imin << std::endl;
}