Get a guaranteed software dev job of ₹5-40 LPA | Apply now for free!

Wipro NLTH Coding Solve | Secret Message Agency | Codewindow.in

SecretMessage agency provides message encoding and decoding services for secure data transfer. The first step in decoding includes removal of special characters and the whitespaces from the message, as special characters and whitespaces do not hold any meaning. Write an algorithm to help the agency find the number of special characters and whitespaces in a given message.

Input
The input consists of a string message, representing the message that need to be decoded by the agency.

Output
Print an integer representing the number of special characters and whitespaces present in a given message.

Constraints
NA

Example

Input:
gasgg54@#vscsd!s*

Output:
4

Explanation:
The special characters having no meaning are (‘@’,’#’;’!’,’*’].

#include<stdio.h>
int main()
{
    char text[1000];
    scanf("%[^\n]s",text);
    int i=0,c=0;
    while(text[i]!='\0')
    {
        if(!((text[i]>='A' && text[i]<='Z') || (text[i]>='a' && text[i]<='z') || (text[i]>='0' && text[i]<='9') ) )
            c++;
        i++;
    }
    printf("%d",c);
}

Also Checkout

Recent Posts