Skip to content

Instantly share code, notes, and snippets.

@kvendrik
Last active August 29, 2015 14:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kvendrik/118a1460ef4d46ae6f72 to your computer and use it in GitHub Desktop.
Save kvendrik/118a1460ef4d46ae6f72 to your computer and use it in GitHub Desktop.
Harvard CS50 Problem Sets
int cryptString (int argc, char* argv[]){
char* s = argv[1];
for(int i = 0; i < strlen(s); i++){
int newAscii = (s[i]+6 > 122 ? ((s[i]+6)%122)+96 : s[i]+6);
printf("%c", newAscii);
}
}
default: practise
practise: practise.c
gcc practise.c -o practise
int piramid(int height){
for(int i = 1; i <= height; i++){
for(int j = 1; j <= (height-i); j++){
printf(" ");
}
for(int k = 1; k <= i; k++){
printf("#");
}
printf("\n");
}
return 0;
}
@kvendrik
Copy link
Author

//Headers

include <stdio.h>

include <math.h>

include <string.h>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment