Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- #include <ctype.h>
- #include <math.h>
- int funkcija(int *niza1, int n1, int *niza2, int n2) {
- int sz;
- if(n1 < n2) {
- sz = n1;
- }
- else {
- sz = n2;
- }
- for(int i = 0; i < sz; i++) {
- if(niza1[i] == niza2[i]) {
- niza1[i] = -1;
- }
- }
- }
- int main(int argc, char * argv[]) {
- int n1;
- scanf("%d", &n1);
- int niza1[n1];
- for(int i = 0; i < n1; i++) {
- scanf("%d", &niza1[i]);
- }
- int n2;
- scanf("%d", &n2);
- int niza2[n2];
- for(int i = 0; i < n2; i++) {
- scanf("%d", &niza2[i]);
- }
- int result = funkcija(niza1, n1, niza2, n2);
- for(int i = 0; i < n1; i++) {
- if(niza1[i] != -1) {
- printf("%d ", niza1[i]);
- }
- }
- }
- /*
- 7
- 7 2 15 0 3 4 5
- 7
- 6 1 15 1 13 4 6
- **/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement