👤

Se citesc trei numere întregi Să se calculeze și afișeze suma pătratelor celor trei numere​

Răspuns :

Pascal :

program k;

var a,b,c : integer;

begin

readln(a,b,c);

write(sqr(a)+sqr(b)+sqr(c));

end.

Python :

a = int(input())

b = int(input())

c = int(input())

print(a**2+b**2+c**2)

C / C++ :

#include <iostream>

using namespace std;

int main(){

int a,b,c;

cin >> a >> b >> c;

cout << ((a*a)+(b*b)+(c*c)) << endl;

return 0;

}

Pseudocod :

var a,b,c : integer;

begin

read a, b, c

write a*a + b*b + c*c

end

JavaScript :

let a,b,c;

console.log(a*a+b*b+c*c);

C / C++:

#include <iostream>

#include <math.h>

using namespace std;

int main(){

int a, b, c, suma;  

cout<<"Introduceti 3 numere intregi\n";

cin >> a >> b >> c;

suma = pow(a,2) + pow(b,2) + pow(c,2);

cout <<suma;

return 0;

}