Skip to content

Instantly share code, notes, and snippets.

@NazemMahmud
Created November 29, 2016 07:01
Show Gist options
  • Select an option

  • Save NazemMahmud/08f1761a2f765a786349957b00a6e7d4 to your computer and use it in GitHub Desktop.

Select an option

Save NazemMahmud/08f1761a2f765a786349957b00a6e7d4 to your computer and use it in GitHub Desktop.
#include<cstdio>
#include<sstream>
#include<cstdlib>
#include<cmath>
#include<algorithm>
#include<iostream>
#include<string>
#include<vector>
#include<cstring>
using namespace std;
int main()
{
//freopen("in.txt","r",stdin);
char ch[300];
while(gets(ch))
{
int count=0, flag=0;
for(int i=0; i<strlen(ch);i++)
{
count++;
if(!flag && isalpha(ch[i])){
ch[i]=toupper(ch[i]);
flag=1;
}
printf("%c",ch[i]);
if(count==sqrt(strlen(ch))){
count=0;
flag=0;
printf("\n");
}
}
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment