# Cottarelle in classe

**URL:** <https://forum.olinfo.it/t/cottarelle-in-classe/4730>\
**Category:** Aiuto\
**Created:** [22 Luglio 2017, 10:42pm UTC](https://forum.olinfo.it/t/cottarelle-in-classe/4730 "2017-07-22T22:42:10Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![frakkiobello](https://forum.olinfo.it/user_avatar/forum.olinfo.it/frakkiobello/32/2768_2.png) [@frakkiobello](https://forum.olinfo.it/u/frakkiobello)\
**Post date:** [24 Luglio 2017, 10:29am UTC](https://forum.olinfo.it/t/cottarelle-in-classe/4730/4 "2017-07-24T10:29:43Z")

</div>

Per usare il fastInput con la funzione citata

> [@Fast I/O](https://forum.olinfo.it/t/fast-i-o/3830/3):
>
> int fast\_read\_int() {  
> int c, n = 0;  
> do c = getchar\_unlocked();  
> while(c \< ‘0’ || c \> ‘9’);  
> do {  
> n = (n \<\< 3) + (n \<\< 1) + (c - ‘0’);  
> c = getchar\_unlocked();  
> } while(c \>= ‘0’ && c \<= ‘9’);  
> return n;  
> }

Dovrei, dopo avere dichiarato la funzione, sostituire per esempio  
`int n,a;`  
` in>>n;`  
` for(int i=0;i<n;i++)`  
` in>>a;`

Con:  
`int n,a,b;`  
` in>>n;`  
` for(int i=0;i<n;i++)`  
`a=getchar_unlocked();`

E basta?

---

_[View the full topic](https://forum.olinfo.it/t/cottarelle-in-classe/4730)._
