Add tags

Add tags to the following comment
mattsanさんの#7145を参考に標準入力に対応しつつgolf化.
164bytes. 改行5,空白4省略可で実質155bytes
本当はoperator<()を定義してcout<cin とかやりたかったけど、短さを優先しました。
1
2
3
4
5
6
7
#include<iostream>
using namespace std;
void f(ostream&o,istream&i){
  int c=0,d=1,n;i>>n;
  while(c<=n)o<<c<<"\n"&&(c+=d)&&c/d/10&&(d*=10);
}
main(){f(cout,cin);}

Add tags

The input will be splited to tags with space.

Index

Feed

Other

Link

Pathtraq

loading...