multiply SI units by chocobi

char*p,*s[]={"*","cd","mol","K","A","s","kg","m"},t[99];l,b[9];main(i,v){for(;gets(t);puts("")){for(;p=strtok(p?0:t," ");)for(v=i=0;!v;++i)b[i]+=v=!strncmp(s[i],p,l=strlen(s[i]))?p[l]?2:1:0;for(i=7,v=1;l=b[i],i;b[i--]=0)v*=!printf(l>1?" %s%d"+v:l?" %s"+v:"",s[i],l);}}

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

To protect the system from spam, please input your favorite sport (hint: I believe its name must start with 'g', case insensitive)

download

return to the top page