Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string.h>
- using namespace std;
- int main() {
- /* SIMULARE BAC 2014 SI
- 1) c. 15
- 2) a) 1
- b) 111, 110, 109
- c) done
- d)
- /* SIMULARE BAC 2014 SIII 4
- int maxx = 0, a[80], n = 1, x;
- while( cin >> x ){
- a[n] = x;
- n++;
- }
- n--;
- double nr=0;
- for( int i = 1; i < n; i++ ){
- int j = 1, p = 10;
- nr = 0;
- while( j <= n ){
- if( j != i && j != i + 1 ){
- if( nr == 0 ){
- nr = a[j];
- }
- else{
- nr = nr * p + a[j];
- }
- }
- j++;
- }
- if( nr > maxx ){
- maxx = nr;
- }
- }
- cout << maxx;
- */
- /* SIMULARE BAC 2014 SII 3
- int a[9][9] = {};
- for( int i = 0; i < 9; i++ ){
- for( int j = 0; j < 9; j++ ){
- if( i == j || i + 1 == j || i - 1 == j){
- a[i][j] = 2;
- }
- else{
- a[i][j] = 1;
- }
- }
- }
- for( int i = 0; i < 9; i++ ){
- for( int j = 0; j < 9; j++ ){
- cout << a[i][j] << " ";
- }
- cout << endl;
- }
- */
- /* SIMULARE BAC 2014 SIII 5
- char s[100];
- cin.getline(s, sizeof(s));
- for( int i = 0; i < strlen(s); i++ ){
- if( s[i] == 'a' || s[i] == 'e' || s[i] == 'i' || s[i] == 'o' || s[i] == 'u'){
- cout << s[i];
- }
- cout << s[i];
- }
- */
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement