diff options
author | Raghuram Subramani <raghus2247@gmail.com> | 2024-09-30 16:08:27 +0530 |
---|---|---|
committer | Raghuram Subramani <raghus2247@gmail.com> | 2024-09-30 16:08:27 +0530 |
commit | 3496b0ed08c51e37e135e686b1632fd86f930c2c (patch) | |
tree | 1da44792489607070f3b4ca14d82af05b73e362b /problems/whatsthatprogression/attachments |
(init): Initialize repository.
Diffstat (limited to 'problems/whatsthatprogression/attachments')
5 files changed, 105 insertions, 0 deletions
diff --git a/problems/whatsthatprogression/attachments/template.c b/problems/whatsthatprogression/attachments/template.c new file mode 100644 index 0000000..ac44136 --- /dev/null +++ b/problems/whatsthatprogression/attachments/template.c @@ -0,0 +1,26 @@ +#include <stdlib.h> +#include <stdio.h> +#include <string.h> +#include <stdbool.h> + +int main() +{ + int income; + float mr; + int savings; + scanf("%d%f%d", &income, &mr, &savings); + int N; + scanf("%d", &N); + for (int i = 0; i < N; i++) { + int price; + int expenses; + scanf("%d%d", &price, &expenses); + } + + // Write an answer using printf(). DON'T FORGET THE TRAILING \n + // To debug: fprintf(stderr, "Debug messages...\n"); + + printf("Yes, the house is affordable with 1 roommate(s) and $1 to spare.\n"); + + return 0; +} diff --git a/problems/whatsthatprogression/attachments/template.cpp b/problems/whatsthatprogression/attachments/template.cpp new file mode 100644 index 0000000..0f9ddf7 --- /dev/null +++ b/problems/whatsthatprogression/attachments/template.cpp @@ -0,0 +1,26 @@ +#include <iostream> +#include <string> +#include <vector> +#include <algorithm> + +using namespace std; + +int main() +{ + int income; + float mr; + int savings; + cin >> income >> mr >> savings; cin.ignore(); + int n; + cin >> n; cin.ignore(); + for (int i = 0; i < n; i++) { + int price; + int expenses; + cin >> price >> expenses; cin.ignore(); + } + + // Write an answer using cout. DON'T FORGET THE "<< endl" + // To debug: cerr << "Debug messages..." << endl; + + cout << "Yes, the house is affordable with 1 roommate(s) and $1 to spare." << endl; +} diff --git a/problems/whatsthatprogression/attachments/template.java b/problems/whatsthatprogression/attachments/template.java new file mode 100644 index 0000000..ee06c60 --- /dev/null +++ b/problems/whatsthatprogression/attachments/template.java @@ -0,0 +1,23 @@ +import java.util.*; +import java.io.*; +import java.math.*; + +class Solution { + + public static void main(String args[]) { + Scanner in = new Scanner(System.in); + int income = in.nextInt(); + float mr = in.nextFloat(); + int savings = in.nextInt(); + int N = in.nextInt(); + for (int i = 0; i < N; i++) { + int price = in.nextInt(); + int expenses = in.nextInt(); + } + + // Write an answer using System.out.println() + // To debug: System.err.println("Debug messages..."); + + System.out.println("Yes, the house is affordable with 1 roommate(s) and $1 to spare."); + } +} diff --git a/problems/whatsthatprogression/attachments/template.js b/problems/whatsthatprogression/attachments/template.js new file mode 100644 index 0000000..cb27e76 --- /dev/null +++ b/problems/whatsthatprogression/attachments/template.js @@ -0,0 +1,15 @@ +var inputs = readline().split(' '); +const income = parseInt(inputs[0]); +const mr = parseFloat(inputs[1]); +const savings = parseInt(inputs[2]); +const N = parseInt(readline()); +for (let i = 0; i < N; i++) { + var inputs = readline().split(' '); + const price = parseInt(inputs[0]); + const expenses = parseInt(inputs[1]); +} + +// Write an answer using console.log() +// To debug: console.error('Debug messages...'); + +console.log('Yes, the house is affordable with 1 roommate(s) and $1 to spare.'); diff --git a/problems/whatsthatprogression/attachments/template.py b/problems/whatsthatprogression/attachments/template.py new file mode 100644 index 0000000..3fa952c --- /dev/null +++ b/problems/whatsthatprogression/attachments/template.py @@ -0,0 +1,15 @@ +import sys +import math + +inputs = input().split() +income = int(inputs[0]) +mr = float(inputs[1]) +savings = int(inputs[2]) +n = int(input()) +for i in range(n): + price, expenses = [int(j) for j in input().split()] + +# Write an answer using print +# To debug: print("Debug messages...", file=sys.stderr, flush=True) + +print("Yes, the house is affordable with 1 roommate(s) and $1 to spare.") |