339A:Helpful Maths

Problem Link

#include<stdio.h>
#include<algorithm>
int main()
{
char b[100],c[100];
int i,j;
gets(b);
j=0;
for(i=0;b[i]!=’\0′;i++){
if(b[i]==’1′ || b[i]==’2′ || b[i]==’3′){
c[j]=b[i];
j++;
}
}
c[j]=’\0′;
int d=j-1;
int k,l;

std::sort(c,c+j);
for(j=0;j<=d;j++){
if(j>0)
printf(“+”);
printf(“%c”,c[j]);
}
return 0;
}

Advertisements

About waprogramming

I am in CSE,from CUET
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s