run time calculator c++ code example
Example 1: run time calculator c++
#include <iostream>
#include <fstream>
#include "header.h"
#include <queue>
#include <bitset>
using namespace std;
bool checkInputFile(ifstream &input) {
if (!input) {
return 0;
}
else {
cout << "Input file has found !" << endl;
return 1;
}
}
bool isEmpty(string s) {
if (s.size() == NULL) {
cout << "Input file is empty." << endl;
return true;
}
else {
cout << "\nContent of the input file : " << s;
return false;
}
}
Example 2: run time calculator c++
cout<<"Enter a string to generate a password from it "<<endl;
cin>>password;
cout<<endl;
Example 3: run time calculator c++
int x ;
int d ;
if(h%x == 0){
cout<< d ;}
else
cout<< x ;
Example 4: run time calculator c++
public static LinkedList fnA(int[] arrayA, int[] arrayB) {
LinkedList<Integer> result = new LinkedList<Integer>();
for (int i=0; i<arrayA.length; i++) {
if (!binarySearch(arrayB, arrayA[i]))
result.add(arrayA[i]);
}
for (int i=0; i<arrayB.length; i++) {
if (!binarySearch(arrayA, arrayB[i]))
result.add(arrayB[i]);
}
return result;
}
Example 5: run time calculator c++
print "number between 5-10'