Ad
Code
Diff
  • #include <stdlib.h>
    
    char *fanis(char* r, int k) {
        char* w = malloc(0);
        int i = 0;  
        if (w != NULL)
            for (; *r; *w++ = k + *r++)
              i++;
        return w - i;
    }
    
    • #include <stdlib.h>
    • char *fanis(char* r, int k) {
    • char* w = malloc(0);
    • for (int i = 0; r[i]; w[i] = k + r[i], i++);
    • return w;
    • }
    • int i = 0;
    • if (w != NULL)
    • for (; *r; *w++ = k + *r++)
    • i++;
    • return w - i;
    • }
Code
Diff
  • #include <stdlib.h>
    
    char *fanis(char* r, int k) {
        char* w = malloc(0);
        for (int i = 0; r[i]; i++)
            w[i] = k + r[i];
        return w;
    }
    • #include <stdlib.h>
    • char *fanis(char* r, int k) {
    • char* w = malloc(0);
    • for (int i = 0; r[i]; w[i] = k + r[i], i++);
    • for (int i = 0; r[i]; i++)
    • w[i] = k + r[i];
    • return w;
    • }
Code
Diff
  • #include <stdlib.h>
    
    char *fanis(char* r, int k) {
        char* w = malloc(0);
        for (int i = 0; r[i]; w[i] = k + r[i], i++);
        return w;
    }
    • int *fanis(char *r,int k) {
    • char *w = malloc(0);
    • for (int i = 0; r[i]; w[i++] = k + r[i]);
    • #include <stdlib.h>
    • char *fanis(char* r, int k) {
    • char* w = malloc(0);
    • for (int i = 0; r[i]; w[i] = k + r[i], i++);
    • return w;
    • }