[ create a new paste ] login | about

Link: http://codepad.org/M7idKHyv    [ raw code | output | fork ]

C++, pasted on Mar 8:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include <iostream.h>
int Chislo(int ch, int pos)
{
    int i, div = 1;
    for(i = 1; i < pos; ++i)
        div *= 10;
    return (ch/div) % 10;
}
int main()
{
    int i;
    for(i = 1; i < 11; ++i)
        std::cout<<Chislo(1234567890, i);
    return 0;
}


Output:
1
0987654321


Create a new paste based on this one


Comments: