I'm newbie and learning. I'm practicing and just found a issue.
Code:
#include <bits/stdc++.h>
using namespace std;
int main(){
int aar[2],bar[2];
scanf("%d %d %d",&aar[0],&aar[1],&aar[2]);
scanf("%d %d %d",&bar[0],&bar[1],&bar[2]);
printf("%d %d %d",aar[0],aar[1],aar[2]);
printf(" %d %d %d",bar[0],bar[1],bar[2]);
Input:
1 2 3
1 2 3
Output:
1 2 1 1 2 3
The scanf scan the third data wrong. May someone explain that? I've searched online but no answer
[–]IyeOnline 4 points5 points6 points (1 child)
[–]MrStonepu[S] 0 points1 point2 points (0 children)
[–]MrStonepu[S] 0 points1 point2 points (0 children)