Skip to content

Instantly share code, notes, and snippets.

@ErnyTech
Last active October 8, 2018 14:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ErnyTech/993e42751d3f616b80d17173f7bf56c0 to your computer and use it in GitHub Desktop.
Save ErnyTech/993e42751d3f616b80d17173f7bf56c0 to your computer and use it in GitHub Desktop.
#include <iostream>
#include <string>
void asterisco(int q);
int main() {
int N;
std::cout << "Inserisci un numero ";
std::cin >> N;
asterisco(N);
return 0;
}
void asterisco(int q) {
std::cout << "Visualizzo una riga di asterischi" << std::endl;
std::string space = "";
for (int a = 0; a < q; a++) {
std::cout << space << "*" << std::endl;
space += " ";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment