Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //zadanie 3 --> tablice dwuwymiarowe
- #include <stdio.h>
- #define N 5
- void suma (float tab[][N], int x, float tab2[]);
- int main (void){
- float tab[3][5]={{5,7,9,2.4,7.3},{3.3,0,6,8.9,0},{4.7,3,2.5,0,0}};
- int i;
- float t2[N];
- suma (tab, 3, t2);
- for (i=0; i<N;i++)
- printf("%f\n", t2[i]);
- return 0;
- }
- void suma (float tab[][N], int x, float tab2[]){
- int j, i;
- for(j=0; j<N; j++){
- float suma=0;
- for(i=0; i<x; i++)
- suma=suma+tab[i][j];
- tab2[j]=suma;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement