Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <math.h>
- #include <stdlib.h>
- int main () {
- char str[8];
- char alph[] = "QWERTYUIOPLKJHGFDSAZXCVBNM";
- for(int i = 0; i < 8; i++){
- fflush(stdin);
- scanf("%c", &str[i]);
- }
- for(int i = 0; i < 8; i++)
- printf("[%c]", str[i]);
- puts("");
- for (int i = 0; i < 8; i++)
- printf ("{%o} ", str[i]);
- puts("");
- for(int i = 0, j = 0; i < 53 , j < 8; i++){
- if(str[j] == alph[i]){
- str[j] &= ~(1 << 3);
- j++;
- }
- else{
- str[j] |= (1 << 8);
- j++;
- }
- }
- for(int i = 0; i < 8; i++)
- printf("[%c]", str[i]);
- puts("");
- for (int i = 0; i < 8; i++)
- printf ("{%o}", str[i]);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement