Skip to content

Commit

Permalink
feat: day 5 easy solution modified
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaizo8 committed Apr 13, 2024
1 parent ac94050 commit ee304f6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion easy/day_5/solution.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,19 @@ int main(){
cin >> n;
long long int prev;
cin >> prev;
if(prev == 1){
prev++;
}
cout << prev << " ";
for(int i = 1 ; i < n ; i++){
long long int temp;
cin >> temp;
if(temp%prev == 0){
if(temp == 1){
temp++;
}
if(temp%prev == 0){
temp = temp + 1;
}
cout << temp << " ";
prev = temp;
}
Expand Down

0 comments on commit ee304f6

Please sign in to comment.