Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // laba4_2
- // Fedorinchik Elvina
- #include "pch.h"
- #define _CRT_SECURE_NO_WARNINGS
- #include <stdio.h>
- #include <locale.h>
- #include <iostream>
- #include <vector>
- #include <cstdlib>
- #include <string>
- using namespace std;
- int main()
- {
- int a[26];
- for (int i = 0; i < 26; i++) {
- a[i] = 0;
- }
- char *s = (char *)malloc(256 * sizeof(char));
- scanf("%s", s);
- for (int i = 0; i < strlen(s); i++) {
- a[s[i] - 'a']++;
- }
- cout << endl;
- for (int i = 0; i < 26; i++) {
- cout << (char)((int)i + 'a') << " ";
- }
- cout << endl;
- for (int i = 0; i < 26; i++) {
- cout << a[i] << " ";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement