I. 1. d 2. c KIMENET: 010111 f(23) f(11) f(5) f(2) | f(1) | | f(0) | | | ki 0 | | [] | | ki 1 | [] | ki 0 [] ki 1 [] ki 1 [] ki 1 3. c s: "bac2023", "ba" k: 2 s['c'-'a'] = '\0' s[2] = '\0' 4. b (rajzolni kell) 5. a (5,3), (3,1), (2,4), (4,2) II. 1. a) x: 6907512 690752 69752 9752 p: 1 10 100 1000 10000 m: -1, 2 5 7 9 c: 2 1 5 7 0 9 6 kimenet: 9752 b) 321 421 c) #include using namespace std; int main() { int x; cin >> x; int p = 1; int m = -1; while (p <= x) { int c = x/p%10; if (c > m) { m = c; p = p * 10; } else { x = x/(p*10) * p + x%p; } } if (m >= 0) cout << x << endl; else cout << "nul" << endl; return 0; } d) beolvas x p <- 1 m <- -1 ha p <= x akkor | ismételd | | c <- [x/p]%10 | | ha c>m akkor | | | m <- c | | | p <- p*10 | | |különben | | | x <- [x/(p*10)]*p + x%p | | [] | |ameddig p>x | [] [] ha m >= 0 akkor kiír x |különben kiír "nul" [] II.2. lac mare ocean ploaie rau s s mare rau ocean ploaie ocean ploaie rau II.3. struct lalea { char denumire[21]; struct { int nrFire; int pretFir; } stoc; } f[10]; III.1. #include using namespace std; int abundent1(int n) { double osztok=0; for(int i=1;i<=n;i++){ if(n%i==0) osztok+=i; } double arany=osztok/n; bool felt=true; for(int i=1;i=arany){ felt=false; break; } } if (felt) return 1; else return 0; } int suma_div(int n) { int s = 0; for(int i=1; i <= n; i++){ if(n % i == 0) s += i; } return s; } int abundent(int n) { double arany_n = (double) suma_div(n) / n; bool felt = true; for(int i = 1; i < n && felt; i++){ if((double) suma_div(i) / i >= arany_n){ felt = false; } } if (felt) return 1; else return 0; } int main() { int n; cin >> n; for(int i=1; i<=n;i++){ cout << i << ": " << abundent(i) << endl; } return 0; } III.2.