Last active
August 29, 2015 14:09
-
-
Save kvendrik/118a1460ef4d46ae6f72 to your computer and use it in GitHub Desktop.
Harvard CS50 Problem Sets
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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); | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| default: practise | |
| practise: practise.c | |
| gcc practise.c -o practise |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; | |
| } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
//Headers
include <stdio.h>
include <math.h>
include <string.h>