Untitled

In this C++ snippet, I set up a program that reads a number of test cases and then outputs half of each number provided in those test cases. It utilizes fast input/output methods for efficiency and demonstrates basic use of loops and integer division.
 avatar
user_5668965
c_cpp
22 days ago
316 B
2
Indexable
Never
#include < bits/stdc++.h >
using namespace std;
 
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define int long long

const int N = 1e5 + 5;

int32_t main()
{
	IOS;
	int t;
	cin >> t;
	while(t--)
	{
		int n;
		cin >> n;
		cout << n / 2 << endl;
	}
	return 0;
}
Leave a Comment