- chenxueze's blog
打印序列
- 2025-2-6 14:09:19 @
#include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin >> n;
int i = 1;
while(i <= n) {
if(i == 1){
cout << i;
}
else {
cout <<"," << i;
}
i ++;
}
return 0;
}
#include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin >> n;
int i = 1;
while(i <= n) {
if(i == 1){
cout << i;
}
else {
cout <<"," << i;
}
i ++;
}
return 0;
}