nu functioneaza si fac acest commit doar sa il termin acasa lol
This commit is contained in:
parent
053fb458ce
commit
fec6bac3ea
1 changed files with 37 additions and 0 deletions
37
401/solutie.cpp
Normal file
37
401/solutie.cpp
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
#include <fstream>
|
||||||
|
#include <iostream>
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
ifstream fin("castel.in");
|
||||||
|
ofstream fout("castel.out");
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
int n, k, b=0;
|
||||||
|
fin >> n;
|
||||||
|
int v[n-1], a[9];
|
||||||
|
for (int i = 0; i < n; i++) {
|
||||||
|
fin >> v[i];
|
||||||
|
}
|
||||||
|
fin >> k;
|
||||||
|
int z[k-1];
|
||||||
|
for (int i = 0; i < k; i++) {
|
||||||
|
fin >> z[i];
|
||||||
|
}
|
||||||
|
for (int i = 0; i < n; i++) {
|
||||||
|
int cp = v[i];
|
||||||
|
while (cp != 0) {
|
||||||
|
a[cp % 10]++;
|
||||||
|
cp = cp / 10;
|
||||||
|
cout << cp << endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (int i = 0; i < 9; i++) {
|
||||||
|
cout << a[b] << " " << a[i] << endl;
|
||||||
|
if (a[b] < a[i]) {
|
||||||
|
b = a[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
fout << "test";
|
||||||
|
fout << b << " " << a[b];
|
||||||
|
return 0;
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue