Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- class StringToInt
- {
- static void Main()
- {
- int a = 3456;
- GetNumber(a);
- }
- static void GetNumber(int a)
- {
- List<char> list = new List<char>();
- for (int i = 0; i < 4; i++)
- {
- int number = a % 10; ;
- string digitStr = "" + number;
- char digitch = digitStr[0];
- list.Insert(0, digitch); //Insert() - подрежда числата правилно в листа
- a /= 10;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment