C++
- voluntas
- @ignis_fatuus
- ブン
- @Linda_pp
- 清楚なC++メイドBOT
- @tzik_tack
- 長谷川一輝
- wraith13
- @jj1bdx
- @cpp_akira
- 安藤敏彦
- @srz_zumix
- Siv3D
- @okdshin
- @hnokx
- @ishidakei
- @take_cheeze
- TAKEI Yuya
- @mumumu
- I (@wx257osn2)
- Tommy6
- わたやん
- @KorekaraSEDB
- @kariya_mitsuru
- @ciniml
- @beam2d
- @grafi_tt
- @nekketsuuu
- LouiS0616
- @volanja
- 大鎌広
- むてら
- ガチKGB
- 三重野賢人
x
30
1
2
using namespace std;
3
int main()
4
{
5
int A[100],n = 0;
6
string read;
7
8
ifstream file("input.txt");
9
10
stringstream str(read);
11
12
while(getline(file, read)){
13
//stringstream str(read);
14
str.str(read);
15
}
16
17
for(int i;str >> i;) {
18
A[n] = i;
19
n++;
20
if (str.peek() == ',')
21
str.ignore();
22
}
23
24
for(int i = 0;i < n;i++){
25
cout<<A[i]<<",";
26
}
27
cout<<endl;
28
29
return 0;
30
}
$ g++ prog.cc -Wall -Wextra -I/opt/wandbox/boost-1.73.0/gcc-10.1.0/include -std=gnu++2a
Start
1,9,6,4,5,
0
Finish