記得要用while (cin >> input) (或while(scanf("%d", &input))喔!
想看答案的自己往下滑🔰🔰
#include<cstdio>
#include<string>
#include<iostream>
#include<stdlib.h>
using namespace std;
int main ()
{
int input;
while (cin >> input)
{
int i = 1;
while (i < input)
{
if(i % 7 != 0)
{
cout << i << " ";
}
i++;
}
cout << endl;
}
}
記得要用while (cin >> input) (或while(scanf("%d", &input))喔!
想看答案的自己往下滑🔰🔰
#include
#include
#include
#include
using namespace std;
int main ()
{
int input;
while (cin >> input)
{
int i = 1;
while (i < input)
{
if(i % 7 != 0)
{
cout << i << " ";
}
i++;
}
cout << endl;
}
}
Sorry,不小心多發了一個文XD