Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ConsoleApplication2.cpp : Defines the entry point for the console application.
- //
- #include "stdafx.h"
- #include <iostream>
- #include <fstream>
- #include <stdio.h>
- #include <string>
- using namespace std;
- int main() {
- int arr[3], digitsFirst[6], digitsSecond[6];
- for (int i = 0; i < 3; i++) {
- cout << "arr[" << i << "]= ";
- cin >> arr[i];
- }
- for (int i = 1; i <= 3; i++) {
- for (int j = 0; j < 6; j++) {
- digitsFirst[j] = arr[i - 1] % 10;
- arr[i - 1] = arr[i - 1] / 10;
- //cout << digitsFirst[j]<<"\n";
- digitsSecond[j] = arr[i] % 10;
- arr[i] = arr[i] / 10;
- //cout << digitsSecond[j];
- }
- for (int j = 0; j < 6; j++) {
- cout << digitsFirst[j];
- }
- cout << "\n";
- for (int j = 0; j < 6; j++) {
- cout << digitsSecond[j];
- }
- cout << "\n";
- for (int j = 1; j <= 6; j++) {
- /*if (digitsFirst[j - 1] == digitsSecond[j]) {
- cout << "collision \n";
- }*/
- }
- }
- return 0;
- }
- //
- //int main()
- //{
- // string word;
- // ifstream myfile("example.txt");
- //
- // ofstream output;
- // output.open("output.txt");
- //
- // if (myfile.is_open())
- // {
- // while (myfile >> word)
- // {
- // if (word.find('x') != std::string::npos)
- // {
- // output << word << " ";
- // }
- // }
- //
- // myfile.close();
- // }
- //
- // else cout << "Unable to open file";
- //
- //
- // return 0;
- //}
- //
- //int* sortArr(int *arr, int len) {
- // for (int i = 1; i < len; i++) {
- // for (int j = 0; j < len; j++) {
- // if (arr[i] > arr[j]) {
- // int temp = arr[i];
- // arr[i] = arr[j];
- // arr[j] = temp;
- // }
- // }
- // }
- //
- // return arr;
- //}
- //
- //int arr1[10], arr2[5];
- //for (int i = 0; i < 10; i++) {
- //cout << "arr1[" << i << "]= ";
- //cin >> arr1[i];
- //}
- //
- //for (int i = 0; i < 5; i++) {
- //cout << "arr2[" << i << "]= ";
- //cin >> arr2[i];
- //}
- //
- //sortArr(arr1, 10);
- //sortArr(arr2, 5);
- //
- //for (int i = 0; i < 5; i++) {
- //cout << arr1[i];
- //}
- //
- //ofstream myfile;
- //myfile.open("example.txt");
- //myfile << "First array: \n";
- //
- //for (int i = 0; i < 10; i++) {
- //myfile << arr1[i]<<" ";
- //}
- //
- //myfile << "Second array: \n";
- //for (int i = 0; i < 5; i++) {
- //myfile << arr2[i] << " ";
- //}
- //
- //myfile.close();*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement