Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- #define MAX 100
- //ne menuvaj!
- void wtf() {
- FILE *f = fopen("broevi.txt", "w");
- char c;
- while((c = getchar()) != EOF) {
- fputc(c, f);
- }
- fclose(f);
- }
- int main()
- {
- wtf();
- // vashiot kod ovde
- FILE *a=fopen("broevi.txt","r");
- int maxbroj,broj;
- int n,max=0;
- while(1){
- fscanf(a,"%d",&n);
- if(n==0){
- break;
- }
- for(int i=0;i<n;i++){
- fscanf(a,"%d",&broj);
- int temp=broj;
- while(temp>=10){
- temp/=10;
- }
- if(temp>max){
- max=temp;
- maxbroj=broj;
- }
- }
- printf("%d\n",maxbroj);
- max=0;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement