ответ:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include
using namespace std;
int main(int argc, char** argv) {
int num, n, co;
cout< < "number? "<
cin> > num;
cout< < "cifra? "<
cin> > n;
int count = 0;
for (; num> 0; count++) {
num /= 10;
}
for (int i = 0; i < count; i++) {
if (num[i] == n) {
co++;
cout< < "number of "<
return 0;
объяснение:
public static void main(String args[]){
java.util.Scanner in = new java.util.Scanner(System.in);
String string = in.nextLine(); char chars[] = new char[4];
chars[0] = in.nextLine().charAt(0); chars[2] = in.nextLine().charAt(0);
for(int sChar = 0; sChar<string.length(); sChar++)
if(string.charAt(sChar)==chars[0])chars[1]++;
else if(string.charAt(sChar)==chars[2])chars[3]++;
System.out.print("\n"+(chars[1]==chars[3]?chars[0]+""+chars[2]:chars[1]>chars[3]?chars[0]:chars[2]));
}
}
ответ:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include
#include
using namespace std;
int main(int argc, char** argv) {
int num, n, co;
cout< < "number? "<
cin> > num;
cout< < "cifra? "<
cin> > n;
int count = 0;
for (; num> 0; count++) {
num /= 10;
}
for (int i = 0; i < count; i++) {
if (num[i] == n) {
co++;
}
}
cout< < "number of "<
return 0;
}
объяснение: