Loading...
More Plaintext Posts
# This is the network config written by 'subiquity'network:ethernets:enp0s3:dhcp4: yesnameservers:addresses: [8.8.8.8,8.8.4.4]version: 2
#include <iostream>#include <vector>#include <algorithm>#include <cstdlib>#include <ctime>using namespace std;// Function to generate random numbersvector<int> generateRandomNumbers(int count, int minValue, int maxValue) {vector<int> numbers;for (int i = 0; i < count; ++i) {numbers.push_back(rand() % (maxValue - minValue + 1) + minValue);}return numbers;}// Function to print a vector of integersvoid printVector(const vector<int>& vec) {for (int num : vec) {cout << num << " ";}cout << endl;}// Function to sort and display numbersvoid sortAndDisplayNumbers(vector<int>& numbers) {sort(numbers.begin(), numbers.end());cout << "Sorted numbers: ";printVector(numbers);}int main() {// Seed the random number generatorsrand(static_cast<unsigned int>(time(0)));int count, minValue, maxValue;cout << "Enter the number of random numbers to generate: ";cin >> count;cout << "Enter the minimum value: ";cin >> minValue;cout << "Enter the maximum value: ";cin >> maxValue;// Generate random numbersvector<int> numbers = generateRandomNumbers(count, minValue, maxValue);// Display unsorted numberscout << "Unsorted numbers: ";printVector(numbers);// Sort and display sorted numberssortAndDisplayNumbers(numbers);return 0;}
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
gggg
test
;Main.asm.386.model small,c ;This bit is important, I think..stack 1000h.datahello db "Hello world!",0.code;includelib libucrt.lib ;All this shit is already here if you have a C object fileincludelib legacy_stdio_definitions.lib ;Except for this. Basically printf, puts etc;includelib libcmt.lib;includelib libvcruntime.lib ;Visual Studio exception handling and type checking. Not needed otherwiseextrn printf:near ;Extern everything you are gonna use from the c obj filesextrn plusTwo:nearextrn exit:nearpublic plusOne ;Have to declare it public for the linker to see it. In NASM, it's .globl or globalplusOne proc ;Our int plusOne(int) function.pop eax ;Parameters are stored on the stack.add eax, 1ret ;eax is whatever is returned from functions. Also why you can only return one thing.plusOne endppublic mainmain procpush offset hellocall printfpush 1call plusTwopush 0call exitmain endpend ;End of file, not program//bruh.c//#include <stdio.h> Has to be included with "includelib legacy_stdio_definitions.lib" in the asm file for some reason.//int printf(const char* format, ...);extern int plusOne(int); //Extern everything you are gonna use from the asm obj filesint plusTwo(int num) {return plusOne(plusOne(num)); //Plus one is defined in the assembly.}