View Code of Problem 69

#include <stdio.h>
#include <iostream>
#include <string.h>
#include <string>
#include <algorithm>
#include <iomanip>
#include<vector>
#include<math.h>
using namespace std;
int main()
{
	int x;
	int y;
	cin >> x;
	if (x < 1) {
		y = x;
	}
	if (1 <= x && x < 10) {
		y = 2 * x - 1;
	}
	if (x >= 10) {
		y = 3 * x - 11;
	}
	cout << y;
}

Double click to view unformatted code.


Back to problem 69