consolidate all repos to one for archive

This commit is contained in:
2025-01-28 13:46:42 +01:00
commit a6610fbc7a
5350 changed files with 2705721 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
#include <iostream>
#include <stdarg.h>
// function with variable number of arguments (...)
int sum (int stev, ...) {
va_list args; // variable arguments list
int arg;
int k, vsota=0;
va_start(args, stev); //set the last parameter before variable arguments list
for (k=0; k<stev; k++) {
arg = va_arg(args, int); // take one argument from variable arguments list
vsota += arg;
}
va_end(args); //End using variable argument list
return vsota;
}
int main() {
std::cout << sum(5, 10, 20, 30, 40, 50) << std::endl;
std::cout << sum(3, 11, 12, 13) << std::endl;
return 0;
}