Last active
October 8, 2018 14:56
-
-
Save ErnyTech/993e42751d3f616b80d17173f7bf56c0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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