added solution
This commit is contained in:
parent
9122e21ff6
commit
e1c2c1994d
31
VL03-01-01/main.cc
Normal file
31
VL03-01-01/main.cc
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
|
||||||
|
// count down from 10 (C)
|
||||||
|
for (int i = 10; i >= 0; i--) {
|
||||||
|
printf("%d\n", i);
|
||||||
|
}
|
||||||
|
|
||||||
|
// count down from 10 (C++)
|
||||||
|
for (int i = 10; i >= 0; i--) {
|
||||||
|
std::cout << i << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
// all capital letters from A to Z (C).
|
||||||
|
for (int i = 65; i <= 90; i++) {
|
||||||
|
printf("%c\n", i);
|
||||||
|
}
|
||||||
|
|
||||||
|
// all capital letters from A to Z (C++).
|
||||||
|
for (int i = 65; i <= 90; i++) {
|
||||||
|
std::cout << char(i) << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
// all capital letters from A to Z (C++).
|
||||||
|
for (char c{'A'}; c <= 'Z'; c++) {
|
||||||
|
std::cout << c << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user