Надеюсь сравнение так надо писать
Объяснение:
#include <bits/stdc++.h>
using namespace std;
long long n, m, a, b;
void squares(long long n, long long m){
while(n){
a += pow(n % 10, 2);
n /= 10;
}
while(m){
b += pow(m % 10, 2);
m /= 10;
cout << a << ' ' << b << '\n';
if (a > b){
cout << a << " > " << b;
else if (a < b){
cout << a << " < " << b;
else{
cout << a << " = " << b;
int main() {
cin >> n >> m;
squares(n, m);
return 0;
A
class Parrot:
def __init__(self):
self.phrase = 'Привет, друзья!'
def say(self):
print(self.phrase)
p = Parrot()
p.say()
B
def __init__(self, phrase):
self.phrase = phrase
p1 = Parrot( "Гав!" )
p2 = Parrot( "Мяу!" )
p1.say()
p2.say()
С
def newText(self, phrase):
p = Parrot( "Гав!" )
p.newText( "Мяу!" )
D
def say(self, count=1):
print(self.phrase*count)
p.say( 3 )
Надеюсь сравнение так надо писать
Объяснение:
#include <bits/stdc++.h>
using namespace std;
long long n, m, a, b;
void squares(long long n, long long m){
while(n){
a += pow(n % 10, 2);
n /= 10;
}
while(m){
b += pow(m % 10, 2);
m /= 10;
}
cout << a << ' ' << b << '\n';
if (a > b){
cout << a << " > " << b;
}
else if (a < b){
cout << a << " < " << b;
}
else{
cout << a << " = " << b;
}
}
int main() {
cin >> n >> m;
squares(n, m);
return 0;
}
Объяснение:
A
class Parrot:
def __init__(self):
self.phrase = 'Привет, друзья!'
def say(self):
print(self.phrase)
p = Parrot()
p.say()
B
class Parrot:
def __init__(self, phrase):
self.phrase = phrase
def say(self):
print(self.phrase)
p1 = Parrot( "Гав!" )
p2 = Parrot( "Мяу!" )
p1.say()
p2.say()
С
class Parrot:
def __init__(self, phrase):
self.phrase = phrase
def say(self):
print(self.phrase)
def newText(self, phrase):
self.phrase = phrase
p = Parrot( "Гав!" )
p.say()
p.newText( "Мяу!" )
p.say()
D
class Parrot:
def __init__(self, phrase):
self.phrase = phrase
def say(self, count=1):
print(self.phrase*count)
def newText(self, phrase):
self.phrase = phrase
p = Parrot( "Гав!" )
p.say()
p.newText( "Мяу!" )
p.say( 3 )