Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main(int argc, char *argv[])
- {
- int i;
- if(argc == 2) {
- int N = atoi(argv[1]);
- for (i = 1; i <= N; i++)
- printf("%d\n", i);
- } else if (argc == 3) {
- int K = atoi(argv[1]);
- int N = atoi(argv[2]);
- for (i = K; i <= N; i++)
- printf("%d\n", i);
- } else if (argc == 4) {
- int K = atoi(argv[1]);
- int S = atoi(argv[2]);
- int N = atoi(argv[3]);
- printf("%d\n", K);
- for (i = K; i<= N; i+=S) {
- printf("%d\n", i);
- }
- }
- }
Add Comment
Please, Sign In to add comment