Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- //this is private library holding the horzental and vertical histogram functions
- #include "/app/oracle/11.2.0/grid/clang/mylib/priv_lib.h"
- #define ON 1
- #define OFF 0
- #define SIZE 100
- void VertHisto(int* array,int size);
- void HorzHisto(int* array,int size);
- int main()
- {
- int c, i, arr[SIZE];
- int nc;
- short s = ON;
- for(i = 0;i < SIZE;i++)
- arr[i] = 0;
- i = nc = 0;
- while((c = getchar()) != EOF) {
- if(c == ' ' || c == '\t' || c == '\n') {
- if(s == ON) {
- s = OFF;
- arr[i] = nc;
- nc = 0;
- i++;
- }
- } else {
- s = ON;
- nc++;
- }
- }
- HorzHisto(arr,SIZE);
- printf("\n");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment