Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- #include <ctype.h>
- int getline(char s[], int n){
- int c, i;
- for (i = 0; i<n && (c = getchar()) != EOF&&c != '\n'; i++) s[i] = c;
- s[i] = '\0';
- while (c != EOF&&c != '\n') c = getchar();
- return i;
- }
- #define MAX 100
- int main()
- {
- int i, hiba = 0, hossz,szamlalo=0;
- char tomb[MAX];
- printf("Kerem adjon meg egy szoveget:\n");
- hossz = getline(tomb, MAX - 1);
- for (i = 0; i < hossz; i++)
- {
- if (tomb[i] != '"' && szamlalo==0)
- {
- tomb[i] = toupper(tomb[i]);
- }
- else if (tomb[i] == '"' && tomb[i-1]!='\\')
- {
- szamlalo++;
- }
- if (szamlalo == 2)
- {
- szamlalo = 0;
- }
- }
- printf("\n%s",tomb);
- getchar();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement