CS50, vigenere.c lack of argv -
i tried check50, , got message command down below.
#include<cs50.h> #include<stdio.h> #include<ctype.h> #include<string.h> #include<stdlib.h> #include<math.h> int main(int argc, string argv[]) { string = argv[1]; int s = strlen(a); if(s == 0) { printf("no keyword entered\n"); return 1; } for(int k = 0; k < s; k++) { if(!isalpha(a[k])) { printf("keyword not alphabetical\n"); return 1; } } string t = getstring(); int = 0; int x = 0; int v = 65; for(int n = strlen(t); < n; ++) { if(isalpha(t[i])) { if(isupper(t[i])) { if(isupper(t[i])) { if(islower(a[x])) { v = v + 32; } int p = a[x]; p = p -v; int 1 =t[i]; 1 = 1 - 65; int b = (1+ p[s%x]%26; b = b + 65; char c = b; printf("%c", c); x = x+1; } if(islower(t[i])) { int p = a[x]; p = p - v; int 1 = t[i]; 1 = 1-97; int b =(1 +p[s%x]%26; b = b + 97; char c = b; printf("%c", c); x = x + 1; } } else { printf)"%c", t[i]); } } printf('\n'); }
error message: :| encrypts "a" "a" using "a" keyword :| encrypts "world, hello!" "xoqmd, rby gflkp!" using "baz" keyword :| encrypts "barfoo" "caqgon" using "baz" keyword :| encrypts "barfoo" "caqgon" using "baz" keyword :| handles lack of argv[1] :| handles argc > 2 :| rejects "hax0r2" keyword
how fix all?
Comments
Post a Comment