Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- //#include<sring.h>
- int main()
- {
- int t,n,cnt=0;
- scanf("%d",&t);
- while(t--)
- {
- cnt=0;
- char ch=' ';
- int sum=0;
- while(scanf("%d%c",&n,&ch))
- {
- cnt++ ;
- sum+=n;
- if(ch!=' ')break;
- }
- printf("%d %d\n",sum,cnt);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement