Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main()
- {
- int pinakas[5][3] = {{1,2,3},{1,2,3},{1,2,3},{1,2,3},{1,2,3}};
- /*for(int i = 0; i < 5; i++)
- {
- printf("Polh %d \n", i + 1);
- for(int j = 0; j < 3; j++)
- {
- printf("Dwse thn mhnaia eispraxh tou %d mhna: \n", j + 1);
- scanf("%d", &pinakas[i][j]);
- }
- }*/
- float moAithousas[5];
- for(int i = 0; i < 5; i++)
- {
- float mo = 0;
- for(int j = 0; j < 3; j++)
- {
- mo += pinakas[i][j];
- }
- moAithousas[i] = mo / 3;
- printf("Mo aithousas polis %d: %f\n", i + 1, moAithousas[i]);
- }
- float moMina[3];
- for(int i = 0; i < 3; i++)
- {
- float mo = 0;
- for(int j = 0; j < 5; j++)
- {
- mo += pinakas[j][i];
- }
- moMina[i] = mo / 5;
- printf("Mo mina %d: %f\n", i + 1, moMina[i]);
- }
- float smallest = 9999;
- int location;
- int month;
- for(int i = 0; i < 5; i++)
- {
- for(int j = 0; j < 3; j++)
- {
- if(pinakas[i][j] < smallest)
- {
- smallest = pinakas[i][j];
- location = i + 1;
- month = j + 1;
- }
- }
- }
- printf("Mikroteri ispraksi %f stin poli %d ton mina %d\n", smallest, location, month);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement