Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- #include <ctype.h>
- int main() {
- int n, m;
- scanf("%d%d", &n, &m);
- int mat[n][m];
- for(int i = 0; i < n; i++) {
- for(int j = 0; j < m; j++) {
- scanf("%d", &mat[i][j]);
- }
- }
- int rezultat = 0 ;
- for(int i = 0; i < n; i++) {
- int ok = 1;
- for(int j = 0; j < m; j++) {
- int broj_na_deliteli = 0;
- for(int k = 1; k <= mat[i][j]; k++) {
- if(mat[i][j] % k == 0) {
- broj_na_deliteli++;
- }
- }
- if(broj_na_deliteli == 2) {
- }
- else {
- ok = 0;
- }
- }
- if(ok == 1) {
- for(int j = 0; j < m; j++) {
- printf("%d ", mat[i][j]);
- }
- printf("\n");
- rezultat++;
- }
- }
- if(rezultat == 0) {
- printf("Ne se ispolnuva uslovot\n");
- }
- else {
- printf("Uslovot go ispolnuvaat %d redici\n", rezultat);
- }
- }
- /*
- 4 4
- 2 2 2 11
- 17 22 13 10
- 3 11 2 2
- 1134 1120 5566 9900
- **/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement