Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdio.h>
- #include <stdlib.h>
- /* run this program using the console pauser or add your own getch, system("pause") or input loop */
- int main(int argc, char *argv[])
- {
- int i, n, suma=0;
- printf("Podaj n liczb ciagu:");
- scanf("%d", &n);
- float A[n];
- for(i=0;i<n;i++)
- {
- printf("Podaj %d wyraz ciagu monotonicznego: ", i+1);
- scanf("%f", &A[i]);
- suma=suma+A[i];
- printf("Suma wynosi %d \n", suma);
- }
- printf("%d", sprawdzenie(n, *A));
- return 0;
- }
- int sprawdzenie(int n, float * A) {
- int r=1, i;
- if (n==0 || n==1) {
- printf("Ciag nie ma wyrazow lub jest tylko 1, nie moge sprawdzic czy jest rosnacy czy nie \n");
- }
- else {
- if (A[0]<A[1]) {
- return 1;
- } else {
- return 0;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement