Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <math.h>
- using namespace std;
- bool somma_quadrati(int Matrice[3][3], int F){
- F=285;
- int D;
- int totale_somma;
- for(int j=0; j<3; j++){
- for(int i=0; i<3; i++){
- D=pow(Matrice[i][j],2);
- totale_somma+=D;
- if(totale_somma==F){
- cout<<true;
- }else{
- cout<<false;
- }
- }
- }
- return true;
- }
- int main(){
- int Matrice[3][3]; // matrice 3x3 da riempire e corrisponde ad un quandrande del sudoku
- int A; // variabile che assumerĂ i valori inseriti
- for(int j=0; j<3; j++){
- for(int i=0; i<3; i++){ // i due for servono per riempire la matrice
- if(A<=1&&A>=9){
- cout<<">>INSERISCI I VALORI DLLA MATRICE 3x3<<\n";
- cout<<"(inserire solo numeri compresi tra 1 e 9!!\n";
- cin>>A;
- Matrice[i][j]=A;
- }
- }
- }
- int somma_quadrati;
- cout<<somma_quadrati;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment