#include <iostream>
using namespace std;
int main() {
int a = 0;
int b = 0;
int c = 0;
int d = 0;
int e = 0;
int f = 0;
cin >> a;
for (e = 0; e < a; e++) {
cin >> b >> c >> d;
for (int i = b + 1; i <= c; i++) {
if (i % d >= 1) {
cout << i << " ";
f++;
}
}
if (f == 0)
cout << "No free parking spaces.";
}
}
#include
using namespace std;int main() {
int a = 0;
int b = 0;
int c = 0;
int d = 0;
int e = 0;
int f = 0;
cin >> a;
for (e = 0; e < a; e++) {
cin >> b >> c >> d;
for (int i = b + 1; i <= c; i++) {
if (i % d >= 1) {
cout << i << " ";
f++;
}
}
if (f == 0)
cout << "No free parking spaces.";
}
}
1. 停車位不包含區間的最大值
2. 要換行
3. 你的f沒有重設為0