Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- ======================
- [ ___T_ ]
- [ | 6=6 | =>HI :-)]
- [ |__o__| ]
- [ >===]__o[===< ]
- [ [o__] ]
- [ .". ]
- [ |_| ]
- [ ]
- ======================
- */
- #include<bits/stdc++.h>
- using namespace std;
- using lli = int64_t;
- void print(){
- for(int i = 1; i <= 10; i++){
- cout << i << " ";
- }
- for(int i = 9; i >= 1; i--){
- cout << i << " ";
- }
- }
- int main(){
- ios::sync_with_stdio(false);
- cin.tie(nullptr);
- cout.tie(nullptr);
- print();
- }
- /*
- ======================
- [ ___T_ ]
- [ | 6=6 | =>HI :-)]
- [ |__o__| ]
- [ >===]__o[===< ]
- [ [o__] ]
- [ .". ]
- [ |_| ]
- [ ]
- ======================
- */
- #include<bits/stdc++.h>
- using namespace std;
- using lli = int64_t;
- const int maxN = 10000;
- int occurence[maxN];
- void print_duplicates(int input[],int n){
- for(int i = 1; i <= n; i++){
- occurence[input[i]] += 1;
- if(occurence[input[i]] == 2){
- cout << input[i] << " ";
- }
- }
- }
- int main(){
- ios::sync_with_stdio(false);
- cin.tie(nullptr);
- cout.tie(nullptr);
- int n;
- cin >> n;
- int input[n + 1];
- for(int i = 1; i <= n; i++){
- cin >> input[i];
- }
- print_duplicates(input,n);
- }
- /*
- ======================
- [ ___T_ ]
- [ | 6=6 | =>HI :-)]
- [ |__o__| ]
- [ >===]__o[===< ]
- [ [o__] ]
- [ .". ]
- [ |_| ]
- [ ]
- ======================
- */
- #include<bits/stdc++.h>
- using namespace std;
- using lli = int64_t;
- #define filein freopen ("in.txt", "r", stdin)
- void print_file(){
- filein;
- int n;
- int sum = 0;
- while(cin >> n){
- sum += n;
- }
- cout << sum;
- }
- int main(){
- ios::sync_with_stdio(false);
- cin.tie(nullptr);
- cout.tie(nullptr);
- print_file();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement