Added some shit
This commit is contained in:
19
C++/FirstProgram/.vscode/launch.json
vendored
19
C++/FirstProgram/.vscode/launch.json
vendored
@@ -1,19 +0,0 @@
|
||||
{
|
||||
// Use IntelliSense to learn about possible attributes.
|
||||
// Hover to view descriptions of existing attributes.
|
||||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "(Windows) Launch",
|
||||
"type": "cppvsdbg",
|
||||
"request": "launch",
|
||||
"program": "enter program name, for example ${workspaceFolder}/a.exe",
|
||||
"args": [],
|
||||
"stopAtEntry": false,
|
||||
"cwd": "${workspaceFolder}",
|
||||
"environment": [],
|
||||
"externalConsole": true
|
||||
}
|
||||
]
|
||||
}
|
||||
BIN
C++/FirstProgram/main
Normal file
BIN
C++/FirstProgram/main
Normal file
Binary file not shown.
@@ -1,9 +1,22 @@
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
int main() {
|
||||
for (int i = 0; i < 10; i++) {
|
||||
cout << i;
|
||||
long factorial(int num) {
|
||||
long factor = num;
|
||||
for (int i = 1; i < num; i++) {
|
||||
factor = i * factor;
|
||||
}
|
||||
return 0;
|
||||
return factor;
|
||||
}
|
||||
|
||||
int main() {
|
||||
int num;
|
||||
cout << "Enter a number to find it's factorial: ";
|
||||
cin >> num;
|
||||
|
||||
long output = factorial(num);
|
||||
cout << output;
|
||||
|
||||
cin >> num;
|
||||
return 0;
|
||||
}
|
||||
Binary file not shown.
5
C++/FirstProgram/makefile
Normal file
5
C++/FirstProgram/makefile
Normal file
@@ -0,0 +1,5 @@
|
||||
all: main.cpp
|
||||
g++ -g -Wall -o main main.cpp
|
||||
|
||||
clean:
|
||||
$(RM) main
|
||||
Reference in New Issue
Block a user