Tuesday, 30 August 2016

Solution of URI 2165 :: Twitting


Before seeing the solution make sure that you tried enough. Don’t paste the whole code, just find out the logic. If you stuck in trouble, just inform me on comment.

/**Bismillahir Rahmanir Rahim.**/

#include <stdio.h>
#include <string.h>

int main()
{
    char twt[600];
    gets(twt);
    printf((strlen(twt)>140)?"MUTE\n":"TWEET\n");
    return 0;
}

3 comments:

  1. #include
    #include
    int main()
    {
    int d,i=0;
    char a[500];
    scanf("%d",&a);
    if(strlen(a)>140) printf("MUTE\n");
    else printf("TWEET\n");
    }

    what are the wrongs in this code??

    ReplyDelete
  2. avoid new line with "%[^\n\r]s".

    ReplyDelete

Note: only a member of this blog may post a comment.